Open JaCoCo report in Intellij IDEA

后端 未结 2 681
故里飘歌
故里飘歌 2020-12-30 20:32

I am trying to find dead code on our application by using a code coverage tool (rather a static code analysis tool). I have chosen JaCoCo and am able to get a report thanks

相关标签:
2条回答
  • 2020-12-30 20:51

    Found the solution. I have installed the coverage plugin and the EclEmma plugin (not sure if this one is really necessary...). Then "Analyse -> Show Coverage Data..." and pick your Jacoco output file. This file HAS to have the .exec extension, otherwise you can't select it. That was my problem...

    Thanks

    0 讨论(0)
  • 2020-12-30 21:12

    "intellij idea" seems to have no way of showing correct coverage value of jacoco report created. It is indeed misleading and unfair when it shows coverage as 0.0 instead of giving an unsupported format error.

    However, as an alternative, we can push jacoco report (created as part of maven build) to the sonar(qube) server using maven-sonar-plugin's target, sonar:sonar

    mvn clean install sonar:sonar -Dsonar.host.url=http://:9000 -Dsonar.projectKey= -Dsonar.branch= -Dsonar.login= -Dsonar.password=

    sonar.projectKey and sonar.branch properties value can be retrieved from corresponding project created in sonarqube.

    0 讨论(0)
提交回复
热议问题