Emma is an Open Source and robust code coverage tool. By default, Sonar is delivered with JaCoCo and Cobertura but if you prefer Emma you just have to install this plugin and go back to your favorite practice: the test driven development.
- Install the Emma plugin through the Update Center or download it into the SONAR_HOME/extensions/plugins directory
- Restart the Sonar server
To make the default code coverage tool:
- Log in as an administrator
- Go to Settings > Configuration > General Settings > Java
- Set the 'sonar.java.coveragePlugin' property to 'emma'
To activate Emma on some projects:
- Add the 'sonar.java.coveragePlugin=emma' when executing the maven plugin. This can be set in pom.xml or in command line.
Or use the 'reuseReports' mode:
See also the Code Coverage by Unit Tests tutorial.
Branch coverage is not calculated as such notion does not exist in Emma.
Release 1.3 (2 issues)
|SONARPLUGINS-2401||Support the property sonar.java.coveragePlugin|
|SONARPLUGINS-2368||Upgrade to Sonar 3.0 API|
Release 1.2.1 (1 issues)
|SONARPLUGINS-1318||The name of the Emma .ec report file is hardcoded and must be "coverage-0.ec"|
Release 1.2 (2 issues)
|SONARPLUGINS-1208||Emma description for report file references and xml file in Sonar UI|
|SONARPLUGINS-1149||The Sonar Emma plugin can't be used with the Sonar Ant or Java runners|
Release 1.1 (2 issues)
|SONARPLUGINS-1090||Sonar Emma Plugin reporting 0.0% coverage|
|SONARPLUGINS-736||Update to EMMA 2.1|
Release 1.0.1 (2 issues)
|SONARPLUGINS-810||Change plugin key to comply with standards|
|SONARPLUGINS-673||Migrate to sonar-dev-maven-plugin from sonar-dev-mojo for integration tests|
Release 1.0 (4 issues)
Release 0.3 (3 issues)
|SONARPLUGINS-176||Add a check to only run on Java projects|
|SONARPLUGINS-152||Emma : add property sonar.emma.reportPath to project settings page|
|SONARPLUGINS-151||Emma : Upgrade to Sonar 1.10 API|
Release 0.2 (3 issues)
|SONARPLUGINS-83||Fix code coverage on multi-modules projects|
|SONARPLUGINS-61||Upgrade to Sonar 1.9|
|SONARPLUGINS-56||Property "sonar.emma.reportPath" is not correctly handle by the plugin|