Unified code coverage report base on analyses from different tests projects

We are using SonarQube version – 8.1 enterprise edition.
Our project is tested using different techniques. Unit test on the project level component test and integration tests. The tests are running from different build/Jenkins jobs and all are using jacoco for code coverage. We would like to create a unified report from all of those test sources in SonarQube.

The closest thing I could think of is accumulation the jacoco reports as suggested here How to configure multi-module Maven + Sonar + JaCoCo to give merged coverage report?

But that means that I need to trigger all of my tests from one point which will not work for us as all those tests are running from different source and triggered from different events.

Maybe portfolio can help here, but from the documents it looks like portfolio unify different services that form the same product and this not my case here.

Any suggestions?


Since you’re producing JaCoCo XML reports (right?) perhaps you could write a script to normalize the paths. Then you can pass them all in to sonar.coverage.jacoco.xmlReportPaths without the need to first combine the reports.


That’s an option, but then I will see the unified coverage in all of the tests projects?
As we are using SonarCube on premises maybe we can unify the results based on some postress tables?


I don’t know what this means. Coverage will be unified in the project under test. If your tests are in different projects though it gets a bit more complicated.

I also don’t know what this means.


Hi Ann,
Thank you for your response.

Yes my tests are in different projects.

When I was saying postgres I was asking if we can issue some report over the sonarQube database that will allow me to generate the unified report as you said ,when your tests are in different projects though it gets a bit more complicated.



THB, I’m not quite sure this is going to work. My memories on this topic are vague, but I think everything needs to be in the same project.