Sbt-native-packager is an AutoPlugin. Add it to your
addSbtPlugin("com.github.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.
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