title: maven release:prepare skips test-jar
body: <p>I`m using maven ver. 3 with following plugin to generate separated *.jar file with tests.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.4&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;core-tests&lt;/id&gt;
              &lt;phase&gt;package&lt;/phase&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>and my release plugin configuration looks following:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.0-beta-8&lt;/version&gt;
      &lt;configuration&gt;
          &lt;releaseProfiles&gt;release&lt;/releaseProfiles&gt;
          &lt;preparationGoals&gt;clean install&lt;/preparationGoals&gt;
          &lt;generateReleasePoms&gt;false&lt;/generateReleasePoms&gt;
          &lt;scmCommentPrefix&gt;
              release plugin -
          &lt;/scmCommentPrefix&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Generating test classes in separated jar works fine until I use:</p>
  
  <pre><code>maven clean deploy
  </code></pre>
  
  <p>When I`m doing release my test-jar is not created:</p>
  
  <pre><code>-Dresume=false release:prepare release:perform
  </code></pre>
  
  <p>Release output:</p>
  
  <pre><code>...
  [INFO] [INFO] [compiler:testCompile {execution: default-testCompile}]
  [INFO] [INFO] Not compiling test sources
  [INFO] [INFO] [surefire:test {execution: default-test}]
  [INFO] [INFO] Tests are skipped.
  [INFO] [INFO] [jar:jar {execution: default-jar}]
  [INFO] [INFO] Building jar: /home/tomcat/hudson_home/jobs/project-core/workspace/target/core-1.2-SNAPSHOT.jar
  [INFO] [INFO] [jar:test-jar {execution: core-tests}]
  [INFO] [INFO] Skipping packaging of the test-jar
  ...
  </code></pre>
  
  <p>I alos tried to use <strong>DskipTests</strong> but also without success</p>
  
  <pre><code>-Dresume=false -Darguments="-DskipTests" release:prepare release:perform -Prelease
  </code></pre>
  
  <p>or</p>
  
  <pre><code>-Dresume=false -Darguments="-Dmaven.test.skip.exec=true" release:prepare release:perform -Prelease
  </code></pre>
  
  <p><strong>How can I generate my test-jar during release?</strong> Why it is skipped?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I found that this problem occures only when I have active <strong>release</strong> profile. I can`t find this profile in any parent pom. Where it comes from? From maven-release-plugin definitions?</p>
  
  <p><strong>RESOLVED</strong></p>
  
  <p>I found profile <strong>release</strong> on hudsons <em>.m2/settings.xml</em>:</p>
  
  <pre><code>&lt;profile&gt;
      &lt;id&gt;release&lt;/id&gt;
      &lt;activation&gt;
          &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;properties&gt;
          &lt;username&gt;*****&lt;/username&gt;
          &lt;password&gt;*****&lt;/password&gt;
          &lt;skipTests&gt;true&lt;/skipTests&gt;
          &lt;maven.test.skip&gt;true&lt;/maven.test.skip&gt;
      &lt;/properties&gt;
  &lt;/profile&gt;
  </code></pre>
  
  <p>I just needed to remove <em>maven.test.skip</em> and everything works fine now.</p>