javaagent should be passed as a VM option, for example:
-javaagent:[path to Jenkins workspace]/tools/libs/jacocoagent.jar=destfile=[path to Jenkins]/jacoco.exec
You pass it as a system property (using -D).
You can pass VM parameters to the Jboss application server through the JAVA_OPTS environment variable. (run.sh will select it if JAVA_OPTS is exported before running the run.sh script). Something like this should do:
export JAVA_OPTS="$JAVA_OPTS -javaagent:[path to Jenkins workspace]/tools/libs/jacocoagent.jar=destfile=[path to Jenkins]/jacoco.exec" ./run.sh
More details on javaagent configuration can be found here:
http://www.eclemma.org/jacoco/trunk/doc/agent.html
source share