I am coding in scala and using SBT with sbt-assembly plugin. My project has a lot of external libraries, and therefore sbt-assembly takes a long time to pack the JAR file. I would like to have a separate jar files for my code and for the dependencies. Therefore, I could simply recompile and repack only my code. How to do this?
Progress so far:
The following commands in the build.sbt
prevents sbt-assembly from packing the libraries:
assembleArtifact in packageScala := false
assembleArtifact in packageDependency := false
Then separate jars can be built by passing following commands: assembly
, assembly-package-scala
and assembly-package-dependency
. They make three jars: one containing my program, one with scala libraries and one with all the dependencies.
However, the jar file is not executable anymore because it does not see the dependencies in the separate jar file. I think I need to add a classpath to assembly-sbt, but I am not sure how to do this.
scala-library-2.10.2-assembly.jar
as well because otherwise the scala repl was unstable. I could make compile it with sbt 0.12.4 and sbt-assembly 0.9.0. – Mcdonough