Simple Jacoco Code coverage question

I am trying to learn more about how jacoco coverage is imported into SonarQube, and this may be a simple question, If I update the JaCoCo XML coverage path at the SonarQube Server level, does it monitor for the existence of the files and automatically import them? Or, do I still need to update my various build scripts to run a sonar-scanner to scan and import the files?

Thanks in advance.

Hi @michaelrowe011 ,
Welcome Sonar community.
If all of your JaCoCo XML coverage files are located in the same path for all projects, you can set the path parameter at the server level. This should work and allow you to override the “general configuration” for specific projects.

The scanner prioritizes parameters in the following order: command line, configuration file then server UI project level, server level.

You will find the documentation here

thanks you, that is understood. The one thing I am looking for is how to ingest those jacoco xml reports without running sonar-scanner. That doesn’t seem to be possible if I understand your response.

Right now we generate jacoco xml reports through a separate build process and I would like to important them independently of running a scanner process.

Hi @michaelrowe011,
Usually code quality analysis is carried out after compilation and execution of unit tests. For some languages ​​like Java, the analysis also needs the compiled code.
If you absolutely want to carry out the scanner independently, I see no other solution than to commit the covrage file, which is not a good practice.