Quantcast

Cobertura Plugin - Linking reports from child module

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Cobertura Plugin - Linking reports from child module

Peter Miklosko
We have project with following layout

parent

app
core
instrumentation

There is cobertura plugin in core module. I'm able to generate reports
from command line no problem at all (XML and HTML) I'm even able to
see them in workspace on Jenkins. However I'm not able to link these
reports with Jenkins Cobertura plugin. The default as per Jenkins
documentation is

**/target/site/cobertura/coverage.xml

This doesn't work due to reports generated in sub-module. I tried following

core/target/site/cobertura/coverage.xml
/core/target/site/cobertura/coverage.xml
**/core/target/site/cobertura/coverage.xml

Cheers

Peter
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Cobertura Plugin - Linking reports from child module

Peter Miklosko
OK, the problem is that I used cobertura plugin as 

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

Instead it should be as 
<build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <formats>
            <format>xml</format>
            <format>html</format>
          </formats>
          <check/>
        </configuration>
        <executions>
          <execution>
            <phase>clean</phase>
            <goals>
              <goal>cobertura</goal>
            </goals>
          </execution>
        </executions>
      </plugin> 
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.1</version>
      </plugin>
    </plugins> 
</reporting>
 
After this I point Jenkins Cobertura plugin to core/target/site/cobertura/coverage.xml
 
Loading...