Introduction
There are several different methods for using Scala + Maven with Eclipse.
Existing Java/Maven Project
If you have an existing java/maven project, you must do three things:
- Install the scala eclipse plugin
- Right click on the project. Go to the Scala Menu and select "Add Scala Nature"
- Update your pom.xml to use the maven-scala-plugin and depend on the scala-library like in the pom shown below.
<project>
...
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.7.2</version>
</dependency>
...
</dependencies>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
...
</project>
correction/update: 2. Right click on the project. Pick Configure. Select "Add Scala Nature"
"Add Scala Nature" is only available after selecting the Scala Perspective