Code coverage and multi module Maven project

In a Maven multi module project, is it expected that a class written in one module but tested in a different module does not have any code coverage information ? There are already a few topics here, but I’m not able to find the answer.

I’ve reproduced that in a small project. ModuleC depends on ModuleB, which in turn depends on ModuleA. Only one unit test, in ModuleC, instantiating classes from all modules. Analysis result in SonarQube shows that classes in ModuleA don’t have any coverage ; the only classes with coverage are in ModuleB and C (so same module and direct dependency). Is that the expected result, or am I missing something ? Property sonar.coverage.jacoco.xmlReportPaths is to my mind correctly set.

Reproduced on SonarQube 8.1 / JaCoCo 1.1.0. Analysis is executed with mvn clean verify sonar:sonar.

Hello,

Thanks for taking the time to prepare a reproducer, in fact, your problem is similar to the one reported here:

Currently, we did not reach any solution, we are still investigating.

You will be able to follow the evolution of the problem on the other thread.

Best,
Quentin

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.