/sonarqube-jacoco-code-coverage

Accompanying repo to tutorial on how to apply the Jacoco plugin to your project and run a SonarQube scan to generate a code coverage report

Primary LanguageJava

Repository to go along with the How To Test Code Coverage Using SonarQube and Jacoco YouTube video and article at tomgregory.com.

Pre-requisites

  • JDK 8+
  • Docker

Running

Running SonarQube

./gradlew dockerComposeUp

This will run SonarQube at locahost:9000.

Running a SonarQube scan

Wait for SonarQube to start, then run:

./gradlew sonarqube

Stopping

./gradlew dockerComposeDown

SonarQube 7 vs. 8

This example runs against the lts version of SonarQube (currently SonarQube 7). An example using SonarQube 8 can be found on the sonarqube-8 branch.