Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate Cobertura Code Coverage Report using Maven from Hudson

Tags:

In my project I need to create Cobertura Code Coverage report from Hudson using maven build.
In Hudson I have added the Cobertura Code Coverage plugin.
I need the complete modification steps of pom.xml.

like image 420
stackoverflowsk Avatar asked Jan 05 '10 12:01

stackoverflowsk


People also ask

How does cobertura check code coverage?

Code coverage is directly calculated when you running the tests – each test you run will add coverage to your Java files.

What is cobertura maven plugin?

Mojo's Maven plugin for Cobertura Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage.


1 Answers

Did you try to add this to your pom.xml in the reporting section?

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

Complete configuration steps can be found here.

like image 139
ewernli Avatar answered Oct 15 '22 20:10

ewernli