I used following command to gather coverage information in xml file -
java -javaagent:/home/user/jacoco-0.8.6/lib/jacocoagent.jar=destfile=/home/user/jacoco-coverage.xml,append=false,includes=com.myapp.* -jar myapplication.jar
jacoco-coverage.xml file but it has contents like following everywhere -
and now when I publish it to Sonar it shows code-coverage as 0 % even though xml file has non-zero size which indicates code was hit.
mvn sonar:sonar -Dsonar.coverage.jacoco.xmlReportPaths=/home/user/jacoco-coverage.xml -Dsonar.host.url=http://localhost:9000/sonarqube
Could you please help to understand if this is an issue while generating coverage in xml file or while publishing report to sonar?