Contents
Getting Started¶
The sbt-native-packager is a plugin. To use it, first create a project/plugins.sbt
file with the following content.
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "x.y.z")
Also, each operating system requires its own tools. These tools are specified in the operating system specific sections.
Version 1.0 and greater¶
If you use sbt 0.13.5 or greater you can enable sbt native packager by enabling it in your build.sbt
.
We recommend to use an archetype for setting up your build
enablePlugins(JavaAppPackaging)
but if you only want the bare minimum you can only add the packager plugin
enablePlugins(SbtNativePackager)
The autoplugins mechanism will import everything automatically.
Build.scala¶
If you use a Build.scala
you can import the available keys
with this statement
import com.typesafe.sbt.SbtNativePackager.autoImport._
Version 0.8.x or lower¶
If you don’t use autoplugins you need to import the available
keys yourself. In your build.sbt
or Build.scala
add
import com.typesafe.sbt.SbtNativePackager._
import NativePackagerKeys._
Packaging Formats¶
*.tar
Packaging format for all systems supporting tar.
universal:packageZipTarballUniversal Plugin »
jdkpackager
Oracle javapackager create packages for your running platform.
jdkPackager:packageBinlJDK Packager Plugin »
Archetypes¶
Java Application
Creates a standalone package with an executable bash/bat script.
enablePlugins(JavaAppPackaging)Learn more »
Java Server
Creates a standalone package with an executable bash/bat script and additional configuration and autostart.
enablePlugins(JavaServerAppPackaging)Learn more »