Description / Feature
Get code coverage for Java project with JaCoCo (an open source and robust Java code coverage tool, developed by the authors of EclEmma). For more information, see: Comparison of Emma, Clover, Cobertura and JaCoCo.
JaCoCo Plugin | 1.1
| 1.2 |
|---|
JaCoCo | 0.5.10 | 0.6.2 |
Installation
- Install the JaCoCo plugin through the Update Center (since Sonar 3.5) or download it into the SONAR_HOME/extensions/plugins directory from the Java Ecosystem page.
- Restart the Sonar server
Usage
See Code Coverage by Unit Tests for Java Project tutorial.
Known Limitations
- Some libraries complain on classes, which were instrumented by JaCoCo, so exclusions must be set:
- Javassist (e.g. when Hibernate used) - "*_javassist_*"
- Drools - "org.drools.*"
- The exact number of line hits is not available, because JaCoCo reports only status of line (no code, not covered, partly covered, fully covered) - see JaCoCo Coverage Counters.