简体   繁体   中英

sbt: how to merge multiple jars

Is there a way to use sbt to just merge (assembly) multiple jars in one jar.

Let say I have:

  • src (empty)
  • lib/lib1.jar
  • lib/lib2.jar

and I want:

  • target/all.jar

Maybe there are some other tools to make that for example using zip to aggregate archives but I think sbt does some useful checks during assembly.

SBT has an assembly plugin:

https://github.com/sbt/sbt-assembly

You should be able to add your static lib/ jars as dependencies then the assembly plugin can wrap it all up into one jar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM