EDIT:
You don’t need to do the things described here if you’re also using Scala. In this case, you can switch to the m2eclipse-scala integration which automatically adds the Scala source folder (beside some other useful things).
Just solved one another annoying problem:
Everytime i had to clean my maven-eclipse-project with “mvn eclipse:clean” and re-created the project, i had to manually re-add the “src/test/scala”-folder to the eclipse project.
Now i found a way to tell maven additional source folders to integrate into the eclipse project: the build-helper-plugin.
So to add my src/test/scala-folder permanently i added the following plugin-configuration to my pom.xml (i also had to add the source) :
<!-- ================== MAVEN BUILDER PLUGIN =================== -->
<plugins>
(...)
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/scala</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-test-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/scala</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
(...)
</plugins>
Wonderful plugin. You can add infinite source folders to your project.
I will surely need it again, when i’m adding the next programming language to my project
One Comment
Ha, this was exactly what I was looking for
Thank you very much for sharing this!
One Trackback
[...] because you can fix missing source-folders with the Maven Build Helper Plugin as i described here] Now that the project is in your workspace, you see that Eclipse shows some errors, and that [...]