We try to use JaCoCo (0.8.12) to collect code coverage information in the Grails (5.3.3) web application compiled for Java11 and running under Tomcat (9.0.88).
Following JaCoCo instructions, I tried to add Java agent to JAVA_OPTS and CATALINA_OPTS in setenv.sh and catalina.sh files. The most information I get was a handful apache classes. No classes from our web application at all.
To enable JaCoCo real-time instrumentation, we used one of the follow command:
export JAVA_OPTS="$JAVA_OPTS -javaagent:/root/jacocoagent.jar=destfile=/root/jacoco.exec,append=true"
or
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/root/jacocoagent.jar=destfile=/root/jacoco.exec,append=true"
Neither of them produce coverage info about our web application.
What should we do?