What are key differences between sbt-pack and sbt-assembly?

后端 未结 2 1953
盖世英雄少女心
盖世英雄少女心 2020-11-29 22:11

I\'ve just stumbled upon the sbt-pack plugin. The development stream seems steady. It\'s surprising to me as I believed that the only plugin for (quoting sbt-pack\'s headlin

2条回答
  •  旧时难觅i
    2020-11-29 22:57

    (Disclaimer: I maintain sbt-assembly)

    sbt-assembly

    sbt-assembly creates a fat JAR - a single JAR file containing all class files from your code and libraries. By evolution, it also contains ways of resolving conflicts when multiple JARs provide the same file path (like config or README file). It involves unzipping of all library JARs, so it's a bit slow, but these are heavily cached.

    sbt-pack

    sbt-pack keeps all the library JARs intact, moves them into target/pack directory (as opposed to ivy cache where they would normally live), and makes a shell script for you to run them.

    sbt-native-packager

    sbt-native-packager is similar to sbt-pack but it was started by a sbt committer Josh Suereth, and now maintained by highly capable Nepomuk Seiler (also known as muuki88). The plugin supports a number of formats like Windows msi file and Debian deb file. The recent addition is a support for Docker images.

    All are viable means of creating deployment images. In certain cases like deploying your application to a web framework etc., it might make things easier if you're dealing with one file as opposed to a dozen.

    Honorable mention: sbt-progard and sbt-onejar.

提交回复
热议问题