When it comes to Code Coverage and Java, you can’t ignore JaCoCo. JaCoCo was created by Marc Hoffmann based on the lessons learned using the popular Emma coverage tool. There are plenty of projects using JaCoCo but there was one missing piece – integrating the coverage report into the automated build. Since there was no JaCoCo Plugin for Jenkins/Hudson the only way developers could see the report was to use Sonar or to generate an HTML report. Neither solution was well integrated into the build.
A few weeks ago I noticed that there was ongoing work to create a Jenkins-JaCoCo integration during this year’s Google Summer of Code. The good news is that the student, Ognjen Bubalo, released the plugin on June 14th (was I the only one who missed it?) . In the meantime two additional releases were completed.
The configuration is similar to the one from the Emma Plugin, as Ognjen used it as the basis for the JaCoCo Plugin. When everything is done right the reports can look like this:
Like other Jenkins plugins, the JaCoCo Plugin has it’s page on the Jenkins wiki. Besides Jenkins I also installed the plugin into a Hudson 2.x installation and it worked like a charm. When you don’t want to change the update center URL you can also download the jacoco.hpi (it’s tricky to find) and upload it directly to Hudson. Thanks to all people involved in creating this plugin. You did a great job!