问题
My project has dependencies on a JAR file that isn't in Ivy, how can I include it directly in the final JAR output by sbt-assembly?
回答1:
Figured out I just have to add them explicitly as unmanaged dependencies in Build.scala
, they are not automatically pulled in from the lib
folder. Adding this line to settings worked:
unmanagedJars in Compile += file("lib/vertica_jdk_5.jar")
回答2:
For a single project setup, putting jars into lib
should work. If you have multi-project setup the lib
directory would be under each subproject like app/lib
.
回答3:
Just an update for those searching unmanaged dependencies: Updated documentation for 0.13.2
is here: http://www.scala-sbt.org/release/docs/Getting-Started/Library-Dependencies.html
来源:https://stackoverflow.com/questions/18749406/how-can-i-add-unmanaged-jars-in-sbt-assembly-to-the-final-fat-jar