title: How to permanently exclude one test class in a Maven build
body: <p>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:</p>
  
  <pre><code>&lt;project ...&gt;
    &lt;build&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
            &lt;excludes&gt;
              &lt;exclude&gt;**/MyTest.java&lt;/exclude&gt;
            &lt;/excludes&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>What is the correct way to achieve my goal? I know that I can use the command-line option <code>-Dmaven.test.skip=true</code>, but I would like this to be part of the <code>pom.xml</code>.</p>