Emma Plugin for Jenkins: Easy Code Coverage Reports

Then click the Install button.
Next, edit your job. In the Post-build Actions section, check the Record Emma coverage report.In the provided text box, enter the path-like pattern to tell Jenkins where to look for the reports. (for instance “*/coverage.xml”). If you leave it blank, Jenkins will search your entire workspace for the coverage.xml generated by Emma (which may take a while if your workspace is large!).

Once you run your build, you’ll get to see a graph on your job’s index page which plots your code coverage over time, and you’ll see it change over time with each build, as you add code and tests.

This graph, like all standard Jenkins graphs, lets you click on the graph to drill down to a specific build. When you do, you’ll see the Emma report for that build:

You can then drill down to individual classes, but coverage is only reported on the method level. Ideally, the plugin would let you see the source file and highlight individual lines to indicate the coverage of specific lines, but this plugin does not support that yet. (Sounds like a great feature for someone to contribute to this plugin!)


There are a few alternatives to Emma. Cobertura is another open source code coverage tool for Java, which also (surprise!) has a Jenkins plugin. Clover is a proprietary coverage engine from the fine folks at Atlassian (Jenkins plugin. Finally, Sonar also provides a view into Emma code coverage results and helps you track coverage over time, along with lots of other juicy metrics about your code. Even better, you can get a Sonar instance integrated with your DEV@Cloud Jenkins instance, making it even easier to get started tracking your code coverage with Jenkins and Emma.

Relevant Documentation

Ryan Campbell


Blog Categories: 


Emma is pretty much deprecated and the team developing it is now concentrating on its successor, JaCoCo. There is already an issue to support JaCoCo: https://issues.jenkins-ci.org/browse/JENKINS-10835

Add new comment