how do I get sbt to gather all the jar files my code depends on into one place?

后端 未结 7 757
栀梦
栀梦 2020-12-24 12:47

I\'m new to sbt. I want it to put all the dependency jar files as well as my jar file into one place. SBT will run the app, but I\'ve got various dependencies s

相关标签:
7条回答
  • 2020-12-24 13:04

    May you looking for this sbt plugin: https://github.com/anvie/sbt-onedir-plugin

    0 讨论(0)
  • 2020-12-24 13:10

    There are many plugins you can use: sbt-assembly, sbt-proguard, sbt-onejar, xitrum-package etc.

    See the list of SBT plugins.

    0 讨论(0)
  • 2020-12-24 13:13

    You could also try SBT Native Packager: https://github.com/sbt/sbt-native-packager (sbt 0.7+)

    This is still a WIP but will be used in Play Framework 2.2 in the coming weeks. With this, you can create standalone ZIP files, Debian packages (DEB), Windows installation packages (MSI), DMG, RPM, and so on.

    0 讨论(0)
  • 2020-12-24 13:18

    Add the following line to your build.sbt file.

    retrieveManaged := true
    

    This will gather the dependencies locally

    0 讨论(0)
  • 2020-12-24 13:22

    Try sbt-pack plugin https://github.com/xerial/sbt-pack, which collects all dependent jars in target/pack folder and also generates launch scripts.

    0 讨论(0)
  • 2020-12-24 13:24

    The SBT docs have a list of "One Jar Plugins":

    • sbt-assembly: https://github.com/sbt/sbt-assembly
    • xsbt-proguard-plugin: https://github.com/adamw/xsbt-proguard-plugin
    • sbt-deploy: https://github.com/reaktor/sbt-deploy
    • sbt-appbundle (os x standalone): https://github.com/sbt/sbt-appbundle
    • sbt-onejar (Packages your project using One-JAR™): https://github.com/sbt/sbt-onejar
    0 讨论(0)
提交回复
热议问题