Tuesday, February 15, 2011

How to get cobertura coverage report for *VO.java files


In some scenario where we want to take coverage report for *VO.java files which has only setters and getters. We might have tried with mvn cobertura:cobertura command where we ever getting coverage for other java files not for VO.java files.

Workaround:

                Default behavior of exclusion file type is **/*VO.class.
 Solution:

<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.2</version>

<configuration>
    <instrumentation>
        <includes>
            <include>**/*VO.class</include>
        </includes>

        <excludes>
            <exclude>**/*Test.class</exclude>
        </excludes>
    </instrumentation>
</configuration>
</plugin>

No comments:

Post a Comment