Including scala -library.jar in the generated Maven package

I would like to use Maven to include all the dependencies needed to run any Scala programs that I write. I guess that would mean at least scala -library.jar, as well as any libraries that I can use.

I don't mind where these dependencies are stored (inside the generated JAR or externally), I'm just looking for a solution that sets up things like the path to the manifest class file and usually requires a minimal amount of manual intervention and a configuration template.

Thanks.

+4
source share
2 answers

You can use the jar-with-dependencies descriptor format that comes with the build plugin :

 <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> 

When you run mvn assembly:assembly you will get a jar with all the dependencies (including any necessary Scala libraries) in the target directory.

+12
source

Use the scala-archetype-simple archetype. Listed below are other archetypes.

0
source

All Articles