Every time I’ve needed to start a new Akka project, I’ve had to go through the process of scaffolding a new project from scratch. So I finally got around to creating a skeleton project that includes the bare minimum dependencies along with a build file, plugins and configuration required to create a fat jar as well as the ability to run in place. You can find the akka-skeleton project here.
To get going with akka-skeleton,
- Modify the
organization, name & versionin
- Rename the package heirarchy under
- Ensure you have atleast one class that
- Akka Actor Module
- Akka Agent Module
- Google Guava
- Joda Time (and
joda-convertto make it work correctly with Scala)
- JUnit, ScalaTest and Akka TestKit
- Akka SLF4J Adapter
The project root looks like this:
1 2 3
project folder contains all the files that help SBT build the project.
1 2 3 4
build.propertiesdescribes the SBT version used to build the project
plugins.sbtdescribes all the SBT plugins used to build the project – for example, the
assemblyplugin is used to create a fat jar of the project including all the dependencies
Dependencies.scaladescribes all the project dependencies – objects from here are imported by the
build.sbtfile when building the project
src folder contains the project source, test and resource files.
Build, Run and Assembly
sbt clean to clean.
sbt compile to build.
sbt run to run.
sbt assembly to create a fat jar.