Monday, April 26, 2010

Zero Cobertura coverage

Recently I had zero code coverage during tests. I had a maven2 project (under maven 1.0.9), with default cobertura version, which was 1.9.

All reports were generated normally except all code coverage was zero (0).



The reason was somehow buggy cobertura version 1.9.
After I put cobertura-maven-plugin configuration into my pom.xml specifying cobertura version 2.4

[sourcecode language="xml"]

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

[/sourcecode]

all went well and finally I had my non-zero coverage :D



(Edit: I've added some pretty screenshots :])

No comments:

Post a Comment