How to setup a Maven Scala project with IntelliJ IDEA support

Setting up a Maven and Scala project with IDEA is simple.

Install IntelliJ IDEA Community Edition and the Scala plugin (File -> Settings -> Plugins -> Available).

Generate your maven project using the simple Scala archetype:

mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create 

Add the Scala compiler lib to your project dependencies in the pom.xml file:

Update the Scala version configuration to a recent release:
Open the a new project. Select the pom.xml in the file dialog.

An notification will pop up. Click "Create Scala Facet".


You can now compile and execute as usual and run the maven build mvn install with the Maven Tool Window. (The M2_HOME environment variable or Maven home settings (File -> Settings -> Maven -> Maven home directory) have to be present.)


  1. Just a heads up, you'll need to add the following to your pom in order for the ${scala.version} property to resolve:

  2. Thanks Hohonuuli! The 2.7.0 in the template is ancient. I added it to the description.

  3. Thank you this was very useful.

  4. Adding the dependency to scala-compiler is required by IDEA (bug ?) not by your project (except if you use class from the compiler of course).

    So I suggest you change the scope from compile to provided or add <optional>true</optional>. So user of your jar will not have required dependency to scala-compiler.

  5. Thank you so much! I was looking for the solution... great, now I've also figured out what mvn archetypes are for.

    Thank you!!!