O'Reilly logo

Building Applications with Scala by Diego Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello world SBT / Scala App

There is another useful plugin for packing the Scala application, which is sbt-native-packager. sbt-native-packager can generate packages for Linux OS like DEB and RPM files. Since this is a new plugin, we need to create a file called plugins.sbt in project/ as follows:

    resolvers += "Typesafe repository" at 
    "http://repo.typesafe.com/typesafe/releases/" 
    addSbtPlugin("com.typesafe.sbt" %% "sbt-native-packager" % "1.0.4") 

At the very end of your build.sbt, you need to add this line:

    enablePlugins(JavaAppPackaging) 

Now we can generate packages with sbt-native-packager using $ sbt universal:packageBin or $ sbt universal:packageZipTarball .

Now we have a ZIP and a TGZ file with your application in the folder hello-world-sbt/target/universal/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required