Skip to content
Advertisement

jacoco with both outputs: file and tcpserver

I am using eclipse 2019-12 in a JDK8 project and I want to check the coverage as I am using a web application through web Browser. For this I have configured Tomcat Server 8 in eclipse and launched with two options (both OK):

  • -javaagent:"/tools/eclipse/dropins/jacoco-0.8.7/lib/jacocoagent.jar=output=tcpserver,address=127.0.0.1,port=8011,includes=com.mypckg.*"
  • -javaagent:"C:finconsumtoolseclipsedropinsjacoco-0.8.7libjacocoagent.jar=output=file,destfile=/tmp/jacoco.exec,append=true,includes=com.mypckg.*"

As I need to check what I am coveraging during the execution AND store the results for future reviews, is there any option to combine both outputs for the same execution?

Advertisement

Answer

is there any option to combine both outputs for the same execution?

according to https://www.jacoco.org/jacoco/trunk/doc/agent.html valid values for output option are

  • file
  • tcpserver
  • tcpclient
  • none

so there is no “combined”, however in case of execution

-javaagent:"/tools/eclipse/dropins/jacoco-0.8.7/lib/jacocoagent.jar=output=tcpserver,address=127.0.0.1,port=8011,includes=com.mypckg.*"

after connection to server your client can retrieve data and store it also in file.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement