Monday, April 25, 2011

Working In Scala with both IntelliJ and Maven

As an IntelliJ advocate and Maven lover (yes it's possible, just
compare it to ANT), I faced the problem of practicing small Scala katas
in a sober environment deprived of a Maven. This was till I discovered
how to include a nice Maven plugin for Scala located here:

So it took me a few second to setup a new file pattern for a fresh pom
file targetting work with Scala. Following the how-to on the above web
site, one just have to include the following repositories:

<name>Scala-Tools Maven2 Repository</name>

<name>Scala-Tools Maven2 Repository</name>

Then update your dependency management as following:


And naturally follows the dependency declaration, where you specify
your interest versus the Scala library:


You can then tune your environment to work with scala and resources
directories as your source/tests directories:


Integration with IntelliJ works nicely when you have activated the
Scala plugin, just importing your freshly created maven project.
IntelliJ automatically flags the scala and resource directories as
source/test directories and proposes your the creation of both Scala
and Java classes when you hit the magic combination ALT + Insert


Post a Comment