I have several levels of Maven nested projects where each module can participate in global integration tests. To have global coverage with multiple modules, I configured jacoco to use and share the same file through modules using the Maven variable ${session.executionRootDirectory}:
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<propertyName>jacoco.failsafeArgLine</propertyName>
<destFile>${session.executionRootDirectory}/target/jacoco-it.exec</destFile>
</configuration>
</execution>
Thus, the same data file is used by each module, regardless of how deeply it is embedded in the submodules. I checked that the correct data file is generated by jacoco when running "mvn clean install".
Now the problem occurs at startup mvn sonar:sonar. It seems that the plugin cannot replace this variable in a real way. In magazines
I see the following:[INFO] JaCoCoItSensor: JaCoCo IT report not found: /home/tomcat/.jenkins/jobs/MYJOB/workspace/${session.executionRootDirectory}/target/jacoco-it.exec
@{session.executionRootDirectory}.
?