sbt / sbt-native-packager

sbt Native Packager
https://sbt-native-packager.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
1.59k stars 438 forks source link
deb docker native-packages rpm sbt sbt-docker sbt-plugin scala

SBT Native Packager

Build Status Build status Codacy Badge sbt-native-packager Scala version support Join the chat at https://gitter.im/sbt/sbt-native-packager Documentation Status

Native Packager Logo

Goal

SBT native packager lets you build application packages in native formats. It offers different archetypes for common configurations, such as simple Java apps or server applications.

Issues/Discussions

Features

Installation

Add the following to your project/plugins.sbt file:

// for autoplugins
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "<version>")

In your build.sbt enable the plugin you want. For example the JavaAppPackaging.

enablePlugins(JavaAppPackaging)

Or if you need a server with autostart support

enablePlugins(JavaServerAppPackaging)

Build

If you have enabled one of the archetypes (app or server), you can build your application with

sbt <config-scope>:packageBin

Examples

# universal zip
sbt universal:packageBin

# debian package
sbt debian:packageBin

# rpm package
sbt rpm:packageBin

# docker image
sbt docker:publishLocal

# graalvm image
sbt graalvm-native-image:packageBin

Read more in the specific format documentation on how to configure and build your package.

Documentation

There's a complete "getting started" guide and more detailed topics available at the sbt-native-packager site.

Please feel free to contribute documentation, or raise issues where you feel it may be lacking.

Contributing

Please read the contributing.md on how to build and test native-packager.

Related SBT Plugins

These are a list of plugins that either use sbt-native-packager, provide additional features or provide a richer API for a single packaging format.

Maintainers

Credits