0

I used following command to gather coverage information in xml file -

java -javaagent:/home/user/jacoco-0.8.6/lib/jacocoagent.jar=destfile=/home/oracle/jacoco-coverage.xml,append=false,includes=com.myapp.* -jar myapplication.jar

This generates 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.

Looks xml file is not generated correctly. Could you please help to generate correct xml file with coverage information?

Alpha
  • 13,320
  • 27
  • 96
  • 163
  • I was looking for something which will directly gather coverage report in `xml` file instead of `exec` – Alpha Apr 27 '21 at 11:39
  • 1
    There is no other way. `jacocoagent` gathers only into binary `exec`, from which then you can generate `xml` report. – Godin Apr 27 '21 at 11:48
  • Thanks @Godin, I went ahead with what you suggested and could achieve what I wanted – Alpha Apr 29 '21 at 06:13

0 Answers0