Sonar-jacoco spams warnings when using the recommended config for multi-module project

Versions

  • SonarQube Cloud
  • maven
  • Jenkins
  • sonar-maven-plugin 5.5.0.6356
  • jacoco-maven-plugin 0.8.14

We follow the multi-module setup from your official guide: a coverage-report module runs report-aggregate, and all modules point sonar.coverage.jacoco.xmlReportPaths to that single aggregated report. The guide explicitly says:

the JaCoCo plugin imports coverage reports module by module, so we need to import the same report multiple times (once for every module)

This works, coverage is imported correctly.

Problem

Commit de0190fc481e (JACOCO-97) added a WARN log every time the importer encounters a file from the aggregated report that doesn’t belong to the current module:

[WARNING] File 'MyClass.java' not found in project sources

On our 60-module / 6000 source files project, this produces 300 000 warnings per
build. But this WARNING is in direct conflict with the recommanded configuration of multi module projects.

Could the warning be hidden behind some sort of flag, or downgraded to a debug log ? Or could you point us to a more up to date method to configure the coverage for our multi module maven project

Hi @Adam_Birem,
You are correct, we recently updated the way we import JaCoCo reports, and more specifically, the way we import aggregate coverage reports. In this process, we modified the import process to be a little more transparent in what it does not manage to map in terms of coverage. But what you are seeing now definitively is excessive.

If you have not tried the new parameter sonar.coverage.jacoco.aggregateXmlReportPaths, I would suggest listing your aggregate reports under that property (and removing your aggregate reports from the old parameter). That property only has to be declared once at the top-level of your project and does not to be repeated in all modules since it will only be read and imported once.

Hopefully that should make the import both faster and quieter.

Let us know if that works for you.

Cheers,

Dorian

Thank you @Dorian_Burihabwa, indeed we missed this update ! We will update our configuration right away !