sbt.version=0.12.0
import com.typesafe.sbt.SbtStartScript
seq(SbtStartScript.startScriptForClassesSettings: _*)
name := "hello"
version := "1.0"
scalaVersion := "2.10.3"
resolvers += "twitter-repo" at "http://maven.twttr.com"
libraryDependencies ++= Seq("com.twitter" %% "finagle-core" % "6.10.0", "com.twitter" %% "finagle-http" % "6.10.0")
At deploy time, Heroku runs sbt clean compile stage
to build your Scala app. Typesafe’s sbt-start-script
adds a stage
task to sbt that generates start scripts for your application.
To use the plugin, create this file:
resolvers += Classpaths.typesafeResolver
addSbtPlugin("com.typesafe.sbt" % "sbt-start-script" % "0.9.0")
Use a Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start a web dyno. In this case, you need to execute the Web
main method.
The sbt-start-script
we added above generates a start script in target/start
. This simple shell script sets the CLASSPATH
and executes the main method for the object you specify. Invoke it from your Procfile: