Maven Archetype for Scala with Java 8 Support

A few weeks back I had to complete a simple programming test for in Scala where I had to show my understanding of Test Driven Development. The fact that I had done very little Scala development was of little concern, like numerous Scala roles I have seen the client was wanted developers that could quickly pick up and become productive in a new language.

First off, coming from a quick introduction to Groovy I was suprised to see Scala does not include an equivalent to Groovy’s improved assertions. Remember I had to do a technical test and wanted to keep the solution as simple as possible. So I started looking for a Maven archetype so that I could provide a complete solution. I found the simple scala archetype, but it only supported Java 7 and the dependencies were rather dated.

The following repository contains an archetype for a Scala project with Java 8 support. The archetype provides dependencies and example tests for JUnit, Specs, and ScalaTest.

Adding the the archetype to your local m2 repository is rather simple:

  • Clone the Git repository
  • Run a maven install (mvn clean install)

After those steps it should be availabe as the last archetype when running mvn generate:archetype.