I have a bit of a problem getting code coverage reports for both Integration Tests and Unit Tests in Sonar for a Maven Plugin project (which uses invoker plugin for the integrat
Since you've configure the sonar as
reuseReports
${project.basedir}/target/jacoco-t.exec
This means you are telling sonar to reuse the existing report from sonar.jacoco.itReportPath. If there is no existing report, there is no any coverage.
In may case, I use the cobertura and reuse its report from maven site generation. as the following configuration properties: -
cobertura
reuseReports
${project.build.directory}/surefire-reports
${project.build.directory}/site/cobertura/coverage.xml
I can get the reuse by using the following command :-
mvn clean install site sonar:sonar
I can reproduce your issue by using the following command :-
mvn clean install sonar:sonar
The coverage is 0%. Since there is no existing report at the report path.
Then please make sure that there is a report named "jacoco-t.exec" as specified before executing the sonar.
Since I'm not familiar with the JaCoCo and do not know which maven phase that produces thae report file. I would suggest to execute the command like the following:-
mvn clean test sonar:sonar
or
mvn clean install sonar:sonar
or the same as mine
mvn clean install site sonar:sonar
I hope this may help.
Regards,
Charlee Ch.