Closed francisdb closed 10 years ago
I cannot replicate this behavior. I tried a setup similar to the one you describe, placing two jars in lib/
, including only one of them via unmanagedJars
, and redirecting unmanagedBase
to a dummy directory. The library included via unmanagedJars
is visible, the other is not found. I tested sbt 0.13.2.
Can you please package a self-contained test case?
Thanks @cunei for checking, just found the issue, seems that one of the jars I include has a manifest with a "Class-Path" property that points to the libs
Any idea on how I could ignore/modify that manifest using sbt? For reference: http://stackoverflow.com/questions/3800462/can-i-prevent-javac-accessing-the-class-path-from-the-manifests-of-our-third-par
Wow, Class-Path in a lib dependency feels evil....
And right now we don't really have a hook to rewrite jar files on the fly, but you could write such a task by hooking the dependencyClasspath
task and altering the jars there.
@jsuereth evil indeed, thanks for the hint
I'm trying to migrate a legacy java project to sbt. Therefore I want to gradually replace the provided jars in lib to managed ones
as I want to ignore the lib folder in my build.sbt I have this:
compile
correctly causes my build to fail because of missing dependencies.Then I add one of the lib jars to the build
compile
succeeds, suddenly all other jars in lib are also added to the java compiler. I would expect them to still be ignored and only mylib.jar to be available.Am I doing this the wrong way or is this a bug? The intelliJ sbt plugin seems to correctly only add the mylib.jar to my project. Any workaround for this issue would be welcome.
some more debug (jdk 8)
I do however see these logs