A sample Scala SBT build.sbt file, and handling “re-run with -deprecation for details”

This example shows a sample Scala SBT build.sbt file, including the last line, which handles the SBT “re-run with -deprecation for details” warning message. If you get the “re-run with -deprecation” message, that last line hands the -deprecation option over to the compiler, so you can see the deprecation problems.

name := "Test App"

version := "0.1"

scalaVersion := "2.12.4"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

libraryDependencies += "com.typesafe.akka" % "akka-actor" % "2.0.2"

scalacOptions += "-deprecation"

The page I linked to also shows this approach:

scalacOptions ++= Seq("-unchecked", "-deprecation")

Another sample SBT configuration file (build.sbt)

While I’m in the neighborhood, here’s another sample build.sbt SBT configuration file I use on a Scalatra and MongoDB (and Casbah) Scala project:

organization := "com.devdaily"

name := "ScalatraTest1"

version := "0.1.0-SNAPSHOT"

scalaVersion := "2.9.1"

seq(webSettings :_*)

libraryDependencies ++= Seq(
  "org.scalatra" %% "scalatra" % "2.0.4",
  "org.scalatra" %% "scalatra-scalate" % "2.0.4",
  "org.scalatra" %% "scalatra-specs2" % "2.0.4" % "test",
  "ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime",
  "org.eclipse.jetty" % "jetty-webapp" % "7.6.0.v20120127" % "container",
  "javax.servlet" % "servlet-api" % "2.5" % "provided",
  "com.mongodb.casbah" %% "casbah" % "2.1.5-1"
)

resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"