title: Maven: skip test-compile in the life cycle?
body: <p>I have project that I set to build with the <code>test-jar</code> and normal jar by using this setting:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;test-jar&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>The problem with this is whenever I upgrade the project version in the pom, I need to do a build with the tests, otherwise maven won't be able to find the test-jar with the correct version during the <code>test-compile</code> phrase. A lot of time I would just want to skip the tests, but due to the test-jar missing, the <code>test-compile</code>phrase will fail.</p>
  
  <p>I tried to use <code>-Dmaven.test.skip=true</code>, but that doesn't seem to skip the <code>test-compile</code> phase. Is there a way to skip this?</p>