Integrating cobertura with Maven 3.0.3

Integrating cobertura with  Maven 3.0.3
Cobertura is a Java code coverage analysis tool. You can use it to determine what percentage of your source code is exercised by your unit tests.

Good tool to  evaluate   any outsourced projects,also for clients to ask for code coverage tool report before the project closure.

STEP-1
Add the below plugin configuration in ur pom.xml
<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>
         </configuration>
         <executions>
           <execution>
             <id>cobertura-check</id>
             <phase>verify</phase>
             <goals>
               <goal>cobertura</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
</plugins>
</build>

STEP-2

mvn clean compile install


step-3
mvn cobertura:cobertura


You should get build success.
The generated report will be under  traget/site/cobertura/index.html

ref link:
cobertura.sourceforge.net/

Comments

Popular posts from this blog

defining functions clojure

Integrating Struts2 with Spring Security using Custom Login Form