I am trying to calculate code coverage for both my Unit tests & Functional tests. After running my unit tests i generate jacoco.exec file. Similarly for functional tests i get jacoco-it.exec file.
Now i want to provide these files as input to sonar as below:
mvn sonar:sonar -Dsonar.jdbc.url="jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8" -Dsonar.jdbc.username=sonar -Dsonar.jdbc.password=sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.jacoco.reportPath=jacoco.exec -Dsonar.jacoco.itReportPath=jacoco-it.exec
But sonar generates 0% coverage at dashboard. Is there any other way i can calculate the coverage from jacoco.exec files, without providing my source code/ binaries to analyse it?
What is the configuration of jacoco in your pom.xml ?
Have you check the path of you report ?
The sample code from sonarqube showing how to have UT, IT and coverage using Jacoco: http://docs.sonarqube.org/display/PLUG/Code+Coverage+by+Integration+Tests+for+Java+Project
https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/java/code-coverage/combined%20ut-it/combined-ut-it-multimodule-maven-jacoco
And I think setting properties in pom.xml is better than use -D parameter ...