Jacco xml file not found in gitlab ci

Java 11, maven, multi module project
Sonar v10.5 Developer edition

Project structure:

sonar not picking up generated jacoco xml files in gitlab pipeline

mvn clean verify sonar:sonar -Dsonar.coverage.jacoco.xmlReportPaths=jacoco-coverage-aggregate-report/target/site/jacoco-aggregate/jacoco.xml


No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths=jacoco-coverage-aggregate-report/target/site/jacoco-aggregate/jacoco.xml


  1. Checked for file existence, using
test -e jacoco-coverage-aggregate-report/target/site/jacoco-aggregate/jacoco.xml || exit


cat jacoco-coverage-aggregate-report/target/site/jacoco-aggregate/jacoco.xml

Before invoking the command, the file is there

  1. Tried adding sonar.coverage.jacoco.xmlReportPaths property in the main pom file

Did not solve it

  1. Works when downloading the file, and running the command from my machine with full path to the file
mvn clean verify sonar:sonar -Dsonar.coverage.jacoco.xmlReportPaths=/Users/omar.salem/Downloads/jacoco1.xml

Related issue:
Sonarqube is unable to pickup code coverage report generated by Jacoco in my gitlab CI pipeline


Where does the top-level jacoco-coverage-aggregate-report directory sit in your project structure? Could you maybe just generate the file straight into target?


Thanks for replying Ann.

the structure is for jacoco to work with multi modules, following this