wondering about support around excluding transitiv...
# general
n
wondering about support around excluding transitive dependencies in Pants v1, I was trying to do something like this:
Copy code
tapir_rev = '0.17.0-M2'
jar_library(
    name="tapir",
    jars=[
        scala_jar(org='com.softwaremill.sttp.tapir', name='tapir-core', rev=tapir_rev),
        scala_jar(org='com.softwaremill.sttp.tapir', name='tapir-akka-http-server', rev=tapir_rev),
        scala_jar(org='com.softwaremill.sttp.tapir', name='tapir-openapi-docs', rev=tapir_rev),
        scala_jar(org='com.softwaremill.sttp.tapir', name='tapir-openapi-circe-yaml', rev=tapir_rev),
        scala_jar(org='com.softwaremill.sttp.tapir', name='tapir-swagger-ui-akka-http', rev=tapir_rev),
        scala_jar(org='com.softwaremill.sttp.tapir', name='tapir-sttp-client', rev=tapir_rev),
    ],
    excludes = [
        exclude('com.typesafe.akka'),
        exclude('com.typesafe.akka', 'akka-http'),
        exclude('com.typesafe.akka', 'akka-http-jackson'),
        exclude('com.typesafe.akka', 'akka-stream')
  ]
)
Is this concept supported?
h
It's been a long time since I looked at this code, but I'm pretty sure your example above works as you expect. Are you not seeing that in practice?
Well, that example put the
excludes=
on a
scala_library
target, but it should work on a
jar_library
as well AFAIK.
@fancy-queen-20734 do you recall how this works?
f
@happy-kitchen-89482 @nutritious-manchester-13635 I think what's missing is that name needs to be an exact match, and with scala artifacts, the scala version is included in the name. You could try
scala_exclude
~but~also, in a jar_library context, you might want to put the excludes on the
scala_jar
declarations so the exclusions happen at resolution rather than classpath construction