title: Maven2 Multiproject Cobertura Reporting Problems During mvn site Build
body: <p>We've got a multiproject we're trying to run Cobertura test coverage reports on as part of our mvn site build. I can get Cobertura to run on the child projects, but it erroneously reports 0% coverage, even though the reports still highlight the lines of code that were hit by the unit tests. </p>
  
  <p>We are using mvn 2.0.8. I have tried running <code>mvn clean site</code>, <code>mvn clean site:stage</code> and <code>mvn clean package site</code>. I know the tests are running, they show up in the surefire reports (both the txt/xml and site reports). Am I missing something in the configuration? Does Cobertura not work right with multiprojects?</p>
  
  <p>This is in the parent .pom:</p>
  
  <pre><code>&lt;build&gt;
      &lt;pluginManagement&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
                  &lt;inherited&gt;true&lt;/inherited&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;clean&lt;/id&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;clean&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  &lt;reporting&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
              &lt;inherited&gt;true&lt;/inherited&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/reporting&gt;
  </code></pre>
  
  <p>I've tried running it with and without the following in the child .poms:</p>
  
  <pre><code>    &lt;reporting&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;cobertura-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/reporting&gt;
  </code></pre>
  
  <p>I get this in the output of the build:</p>
  
  <pre><code>...
  [INFO] [cobertura:instrument]
  [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
  Instrumenting 3 files to C:\workspaces\sandbox\CommonJsf\target\generated-classes\cobertura
  Cobertura: Saved information on 3 classes.
  Instrument time: 186ms
  
  [INFO] Instrumentation was successful.
  ...
  [INFO] Generating "Cobertura Test Coverage" report.
  [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
  Cobertura: Loaded information on 3 classes.
  Report time: 481ms
  
  [INFO] Cobertura Report generation was successful.
  </code></pre>
  
  <p>And the report looks like this:
  <img src="https://i.stack.imgur.com/D7yiM.png" alt="cobertura report"></p>