Skip to content

aeells/jacoco-sonar-reference-impl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jacoco-sonar-reference-impl

Maven failsafe plugin, Jacoco code coverage and Sonar reference implementation.

It is often tricky to retro-fit Jacoco code coverage into an existing multi-module maven project, particularly enabling the separate tracking of unit and integration test coverage.

This reference implementation should make it clearer exactly what is required without any additional noise.

All of the required configuration is in the system-under-test maven modules' pom.xml file for reference.

Reference

Further to Arnaud Héritier's excellent post 'Maven, failsafe, sonar and Jacoco are in a boat...'

System

Mac OS X 10.10.1

Prerequisites

Sonar installed and running on MySQL on localhost. Please see the example sonar-runner.properties and sonar.properties files.

$ brew install mysql sonar sonar-runner

$ vim /usr/local/Cellar/sonar-runner/2.4/libexec/conf/sonar-runner.properties

$ vim /usr/local/Cellar/sonar/5.0/libexec/conf/sonar.properties

$ sonar console

Usage

$ mvn -B clean verify -pl system-under-test -Pcoverage

$ mvn -o sonar:sonar -pl system-under-test

Result

Browse to localhost:9000 and if you have added the 'Integration Tests Coverage' widget to the dashboard you should see separate unit and integration test results.

Separate unit and integration test coverage results visible in Sonar.

About

Maven failsafe plugin, Jacoco code coverage and Sonar reference implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages