Corubba
Corubba

Reputation: 2243

cobertura on pom-packaging module

I have a multi-module maven project. I want to generate a aggregated cobertura report for the website. The Module im running mvn site on is pom-packaging, so maven give me this when generate the site

[INFO] >>> cobertura-maven-plugin:2.5.1:cobertura (report:cobertura) @ parent >>>
[INFO] 
[INFO] --- cobertura-maven-plugin:2.5.1:instrument (report:cobertura) @ parent ---
[INFO] Skipping cobertura mojo for project with packaging type 'pom'
[INFO] 
[INFO] <<< cobertura-maven-plugin:2.5.1:cobertura (report:cobertura) @ parent <<<
[INFO] Not executing cobertura:report as the cobertura data file (/home/user/parent/target/cobertura/cobertura.ser) could not be found

The related pom part:

...
<reportPlugins>
  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>cobertura-maven-plugin</artifactId>
    <version>2.5.1</version>
    <configuration>
      <aggregate>true</aggregate>
    </configuration>
  </plugin>
</reportPlugins>
...

Cobertura only generates a empty target/site/cobertura/index.html file. Is there a way to "force" cobertura to run? Or another way to get my aggregated report?

Upvotes: 1

Views: 2871

Answers (2)

Sairam Krish
Sairam Krish

Reputation: 11701

In report generation, we should have output format html enabled, like below.,

<reporting>
  <plugins>
....
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.6</version>
        <configuration>
            <formats>
                <format>html</format>
                <format>xml</format>
            </formats>
        </configuration>
    </plugin>

       </plugins>
    </reporting>

Upvotes: 1

Tom Gordon
Tom Gordon

Reputation: 19

In your configuration section use:

 <forceMojoExecution>true</forceMojoExecution>

Upvotes: 1

Related Questions