Adding the latest release of Akka to an SBT project

A quick note how to create a SBT project with the latest release of Akka.

Create a build.sbt file:

name := "ScalaAkkaTest"

organization := "<Your organisation name>"

version := "0.1.0-SNAPSHOT"

scalaVersion := "2.11.2"

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

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

Continue reading

Advertisements

To compile XML syntax, the scala.xml package must be on the classpath

I was creating a servlet using Scala and got the following error message “To compile XML syntax, the scala.xml package must be on the classpath”. It turns out that Scala-XML has been factored out into a separate library as of Scala 2.11, so it is not included in Scala projects by default. So the dependency needs to be include in the project build.sbt using the following statement:

libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.0.2"

Note as always you should check that there isn’t a newer version available of the library. How? Google is your friend 🙂

maven org.scala-lang.modules scala-xml

Happy coding!