Reputation: 2733
I managed to exclude files from "src/main/java" using the following lines:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<excludes>
<exclude>**/MyExcludedFile.java</exclude>
</excludes>
</configuration>
</plugin>
After adding that, maven generated the following lines of my .classpath file:
<classpathentry excluding="**/MyExcludedFile.java" kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
Now how do I do the same thing for src/test/java?
I'm expecting something like this to be on my .classpath file:
<classpathentry excluding="**/MyExcludedFile.java" kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry excluding="**/MyExcludedFileTest.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
Take a look on the third line. I want this -> [excluding="**/MyExcludedFileTest.java"] to be on my .classpath file. How do I tell maven to do that?
Upvotes: 2
Views: 5889
Reputation: 9189
For me it didn't work by handling testExcludes but by directly modifying the eclipse plugin configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<sourceExcludes>
<exclude>**/MyExcludedFile.java</exclude>
</sourceExcludes>
</configuration>
</plugin>
Upvotes: 0