Sbt-native-packager is an AutoPlugin. Add it to your
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "x.y.z")
Your first package¶
Native packager provides packaging format plugins and archetype plugins to separate configuration and actual packaging. To get started we use the basic Java Application Archetype. For more archetypes see the archetypes page.
build.sbt you need to enable the archetype like this
This will also enable all supported format plugins.
Run the app¶
Native packager can stage your app so you can run it locally without having the app packaged.
sbt stage ./target/universal/stage/bin/<your-app>
Create a package¶
We can generate other packages via the following tasks. Note that each packaging format may needs some additional configuration and native tools available. Here’s a complete list of current formats.
universal:packageBin- Generates a universal zip file
universal:packageZipTarball- Generates a universal tgz file
debian:packageBin- Generates a deb
docker:publishLocal- Builds a Docker image using the local Docker server
rpm:packageBin- Generates an rpm
universal:packageOsxDmg- Generates a DMG file with the same contents as the universal zip/tgz.
windows:packageBin- Generates an MSI