Jacoco and sonarqube

  • Using Sonarqube Community Edition 8.9.2 LTS
  • I am trying to get Jacoco coverage data
  • I have tried to install the jacoco sonar plugin and I get the following error from the web logs in sonarqube:

Web server startup failed: Found a plugin ‘JaCoCo’ in the directory ‘extensions\plugins’ with the same key [jacoco] as a built-in feature ‘JaCoCo’. Please remove ‘extensions\plugins\sonar-jacoco-plugin-’.

Should I assume that Jacoco is already built-in in this version? I have tried to find a guide to use Jacoco that is up to date but I couldn´t (Most messages in the forum are from 2019 or 2020).

Also instead of using Maven or any other build tool I would like just to scan a folder of code with jacococli.jar and create a Jacoco XML report to be imported by Sonarqube. Is that possible?

Hello Miguel,

You are correct to assume the JaCoCo plugin is already bundled into the core of your Sonarqube Community Edition 8.9.2 LTS
Therefore you can safely remove the ‘extensions\plugins\sonar-jacoco-plugin-’ file

As far as SonarQube is concerned, whatever method it takes to create the Jacoco report in XML format is fine. That said , taking advantage of JaCoCo’s report goal in Maven is usually the easiest option.

You could get inspiration from this online example