On pants 1.27, I noticed that `jar_library` has a ...
# general
b
On pants 1.27, I noticed that
jar_library
has a
managed_dependencies
field, but
scala_library
does not? Would it still work if I passed it in via the payload?
Copy code
class AiqScalaLibrary(ScalaLibrary):
  def __init__(self, java_sources=None, payload=None, managed_dependencies=None, **kwargs):
    if managed_dependencies is not None:
        payload = payload or Payload()
        payload.add_fields({
            'managed_dependencies': PrimitiveField(managed_dependencies),
        })
    super(AiqScalaLibrary, self).__init__(java_sources=java_sources,payload=payload,**kwargs)
I'm trying to use
managed_dependencies
to build a top-level jvm binary, which deps on a scala library, which (deep down) has another scala dep where I want to enforce v1 or v2 of it
@wide-energy-11069 I think I see the issue. Coursier resolve only looks at the global dep manager? The ivy one looks at both the manager for the jar else falls back to global one
Wait nm, I guess that param is unused
w
internally at twitter, we don’t use this feature, so hard to tell. although scala_jar is still a jar. maybe https://github.com/pantsbuild/pants/blob/1.25.x-twtr/testprojects/src/java/org/pantsbuild/testproject/depman/TEST_BUILD offers a bit more info.
b
ScalaLibrary
is a jvm target right? Here it looks specifically for
JarLibrary
Oh nm, I'm confusing JarLibrary vs JavaLibrary
Maybe a better question to ask: can I pass in
managed_dependencies
to
jvm_binary
? I want to do that so I can build the binary twice, once with pinned v1 and once with pinned v2
w
had no experience in that per se.
can I pass in 
managed_dependencies
 to 
jvm_binary
If not, you can always create an another scala_library with managed deps, assuming managed deps works for scala library.