I have project that collects dependencies for an installer (sbt-install4j) using dependencyClasspath
. It works most of the time, except when I have one specific dependency:
libraryDependencies += "org.bytedeco" % "javacpp" % "0.10"
"javacpp" will not be added to the dependencyClasspath
. You can create a simple SBT project with only that dependency above and try show dependencyClasspath
, it will print:
[info] List(Attributed(C:\Users\me\.sbt\boot\scala-2.10.4\lib\scala-library.jar))
there is no "javacpp". Any clues what may be happening? Is this an SBT bug?
sbt
excludes certain packaging types from the classpaths it generates, because not all packaging types make sense to depend on. Unfortunately, it seems to do this exclusion silently - and the default value of classpathTypes
isn't always what you want.
The packaging type of the dependency can be found in the dependency's pom.xml
or ivy.xml
(as applicable). There are two main cases:
pom
, this probably means it's a parent pom and you are trying to depend on the wrong thing - look for the specific Maven module you actually want!maven-plugin
- as in this particular case - you need to add the packaging type to classpathTypes
, using: classpathTypes += "maven-plugin"
Other cases are probably going to be similar to one of the above two cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With