在 Tomcat 上使用 JaCoCo Java 代理获取我的应用程序的代码覆盖率

2022-01-17 00:00:00 sonarqube java tomcat jacoco

I want to measure the code coverage of integration tests using the JaCoCo and Sonar tools.

For that, I start my Tomcat 5.5 configured with the JaCoCo agent in order to get the dump file from JaCoCo.

Thus, I set the JAVA_OPTS for that:

set JAVA_OPTS=-Xrs -XX:MaxPermSize=256m -XX:PermSize=256m -XX:NewRatio=3 -Xms512m -Xmx1024m -XX:+UseParallelGC -javaagent:C:devserversjacoco-agent.jar=destfile=C:devserversjacoco.exec,append=true,includes=my.application.*

When I start Tomcat, the C:devserversjacoco.exec file is generated, but no data is filled.

Is there something I forgot in the configuration of my server?

Regards.

解决方案

As far as I remember - file would be populated during shutdown of Tomcat.

相关文章