SBT Native Packager

Write once - deploy anywhere

Myself


  • SW Engineer at Gutefrage.net
  • Java / Scala Enthusiast
  • Eclipse  IDE User
  • Twitter / Github @muuki88


Java / Scala


Write once - run anywhere
Write once - deploy anywhere

Anywhere is





Native Packager Goals




#1 Build on native platform




#2 provide archetypes




#3 enforce best practices

Use it

     plugins.sbt
addSbtPlugin("com.typesafe.sbt" %% "sbt-native-packager" % "1.0.2")        

     build.sbt 
// sbt autoplugins
enablePlugins(JavaAppPackaging)

// minimal configuration
maintainer := "Nepomuk Seiler <nepomuk.seiler@mukis.de>"
packageSummary := "My awesome application"




Core Concepts





mappings: Seq[(File, String)]

file in build -> path in package/target system

Manage Mappings

     build.sbt

import NativePackagerHelper._

mappings in Universal += ((baseDirectory.value / "LICENSE") -> "LICENSE")

mappings in Universal += {
  val conf = (resourceDirectory in Compile).value / "reference.conf"
  conf -> "conf/application.conf"
}

mappings in Universal ++= contentOf(baseDirectory.value / "extras")
     by convention 
src/universal/LICENSE
src/universal/conf/application.conf




Archetype AutoPlugins

setup everything, so you don't have to care

LIVE DEMO










I ALSO LIKE TO LIVE DANGEROUSLY

  • Bugfixes
  • Rocket / rkt
  • Windows Services
  • Documentation




The shape of things to come

THANK YOU, COMMUNITY



Find us on  GitHub


https://github.com/sbt/sbt-native-packager

Code once, deploy anywhere

By Nepomuk Seiler

Code once, deploy anywhere

Scaladays 2015

  • 1,231