Reputation: 1542
Is there a way that I can use sbt package to include a few external jars but not all. I am aware about sbt assembly but that will include all the jars that is configured in build.sbt
Upvotes: 1
Views: 815
Reputation: 4587
You can use the assemblyExcludedJar
setting in the assembly plugin. There's an example in the sbt-assembly README:
assemblyExcludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp filter {_.data.getName == "compile-0.1.0.jar"}
}
Upvotes: 0
Reputation: 39
In that case you have to give the dependencies without "provided" option and add "provided" to exclude the dependencies for packages in build.sbt file.
Example: Here I have given "provided" for spark-streaming dependency, which will not be included in my fat jar:
"org.apache.spark" %% "spark-streaming" % sparkVersion % "provided"
But pureconfig dependency package which will be included in my fat jar as I have not mentioned the "provided" keyword:
"com.github.pureconfig" %% "pureconfig" % "0.12.3"
Upvotes: 2