+1  A: 

I haven't been succesful at getting Cobertura to combine reporting from multi-projects. This has been a problem in general with multi-project reporting.

We have been evaluating sonar as a solution for our metrics reporting. It seems to do a great job of providing summary metrics across projects, including multi-proijects.

John Stauffer
+1  A: 

I suspect that you're missing an execution of cobertura plugin during the compile phase so that the code only gets instrumented by the reporting plugins, in the site lifecycle, after the tests were run. So the test runs aren't picked up because they run on non-instrumented code. Analyze your build logs more carefully - if I'm right, you'll notice that surefire tests are executed before cobertura:instrument.

My configuration is similar to yours, but in addition to specifying the clean exectution in pluginManagement (like you), I specify the cobertura plugin explicitly in build plugins section:

  <build>
  ...
    <plugins>
    ...
      <plugin>
        <inherited>true</inherited>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>${cobertura.plugin.version}</version>
      </plugin>
    </plugins>
  </build>

My configuration sorta works, and all Cobertura stuff is in the global organization-wide pom, which all projects use as a parent.

This way projects don't specify anything Cobertura-related in their pom.xml's, but they still generate coverage reports.

Aleksander Adamowski
A: 

The solution implemented by me is somewhat manual, but works. It consists of several steps of one is a step to combine the several .ser files that are generated by Cobertura. This can be done by using the cobertura-merge commandline tool inside a maven task.

According to the output you show is that the files are not actually instrumented, it tells that only 3 files are instrumented.

Marco