logger.debuglines of code, so I had to tell it to ignore all logger calls, as follows:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.2</version> <configuration> <formats> <format>html</format> </formats> <instrumentation> <ignores> <ignore>org.apache.log4j.*</ignore> </ignores> </instrumentation> </configuration> <executions> <execution> <phase>deploy</phase> <goals> <goal>cobertura</goal> </goals> </execution> </executions> </plugin>You can run it using
mvn cobertura:coberturaand then look at the report in
target/site/cobertura/index.html. Cobertura will also highlight some code which is impossible to test. For example, if a class has a private constructor (because it has static methods), then it will highlight the private constructor, even though you can't test it (unless you use reflection and change the constructor's accessibility, but that is going a bit too far!).