I'm trying to exclude a single test from my maven build (I don't want the test to be compiled or executed). The following doesn't work:
<project ...>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/MyTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
What is the correct way to achieve my goal? I know that I can use the command-line option -Dmaven.test.skip=true
, but I would like this to be part of the pom.xml
.