0
votes

I have a multi-project SBT build: some projects are dependent on each other, some are dependent on third-party JARs, and there's a "main" project which depends on everything .

When I sbt package it, I get one JAR in each target/ directory.

What I want to achieve is getting all relevant JARs (mine and external) is one directory. Very similar to the way you package a WAR with Maven.

(And to clarify - I'm not interested in an assembled "FAT JAR" that contains all the dependencies in a single file. Just one directory with all JARs in it)

2

2 Answers

0
votes

Im not 100% sure about the suprobject dependencies but I think SBT native packager should help you do something like that, and will also provide a start-script for windows and unixes:

http://www.scala-sbt.org/sbt-native-packager/GettingStartedApplications/MyFirstProject.html

0
votes

I would recommend sbt-pack for creating self-contained JARs:

https://github.com/xerial/sbt-pack

I use it and haven't seen a glitch so far.

It also generates both OS X/Linux as well as Windows .bat entry scripts for the main classes/objects you choose.