title: How do I configure when cobertura tests run in maven-cobertura-plugin?
body: <p>In order to fine-tune which tests are run at which times and in which environments, we have several executions set up for the maven-surefire-plugin. We set the default configuration to skip all tests, then enable them for the executions we want.  This by itself works well for us.</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-surefire-plugin&lt;/artifactId&gt;
    &lt;configuration&gt;
       &lt;skip&gt;true&lt;/skip&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
       &lt;execution&gt;
         &lt;id&gt;unit-tests&lt;/id&gt;
         &lt;phase&gt;test&lt;/phase&gt;
         &lt;goals&gt;
            &lt;goal&gt;test&lt;/goal&gt;
         &lt;/goals&gt;
         &lt;configuration&gt;
            &lt;skip&gt;false&lt;/skip&gt;
            &lt;includes&gt;
               &lt;include&gt;**/*Tests.java&lt;/include&gt;
            &lt;/includes&gt;
            &lt;excludes&gt;
               &lt;exclude&gt;**/*IntegrationTests.java&lt;/exclude&gt;
            &lt;/excludes&gt;
         &lt;/configuration&gt;
       &lt;execution&gt;
       &lt;execution&gt;
         &lt;id&gt;integration-tests&lt;/id&gt;
         &lt;phase&gt;integration-test&lt;/phase&gt;
         &lt;goals&gt;
            &lt;goal&gt;test&lt;/goal&gt;
         &lt;/goals&gt;
         &lt;configuration&gt;
            &lt;skip&gt;false&lt;/skip&gt;
            &lt;includes&gt;
               &lt;include&gt;**/*IntegrationTests.java&lt;/include&gt;
            &lt;/includes&gt;
         &lt;/configuration&gt;
       &lt;execution&gt;
     &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>When I add the maven-cobertura-plugin to the mix, I run into problems. The cobertura goal runs, and successfully instruments my classes. However, no tests get run. I assume this is because the test execution that cobertura is running in is one that is skipped. However, I cannot find how to specify which phase and goal to set up for this execution. When I turn on all tests, the output seems to indicate that these are still running in these unit-tests and integration-tests phases/goals.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
    &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
    &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;2.4&lt;/version&gt;
    &lt;configuration&gt;
       &lt;formats&gt;
          &lt;format&gt;xml&lt;/format&gt;
          &lt;format&gt;html&lt;/format&gt;
       &lt;/formats&gt;
    &lt;/configuration&gt;
    &lt;executions&gt;
       &lt;execution&gt;
          &lt;phase&gt;package&lt;/phase&gt;
          &lt;goals&gt;
             &lt;goal&gt;cobertura&lt;/goal&gt;
          &lt;/goals&gt;
       &lt;/execution&gt;
    &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>How do I need to specify a surefire execution so that the cobertura will run it against the instrumented classes?</p>