address |
IP address or hostname to bind to when the output method
is tcpserver or connect to when the output
method is tcpclient. In tcpserver
mode the value "*" causes the agent to accept
connections on any local address. |
loopback interface |
Hi,
I need a urgent to generate jacoco remote by accessing a server running remotely. Somehow, I can access that server without authentication. I am trying jacoco on the fly instrumentation (output=tcpserver) and trying to dump instrumented data by running a ant task from local machine. Please see be build.xml. Somehow I am not able to connect remote server.
I would highly appreciate any help regarding that.
<project name="JaCoCo" xmlns:jacoco="antlib:org.jacoco.ant">
<property name="result.exec.file" value="jacoco.exec"/>
<property name="server" value="remote server if" />
<property name="port" value ="6300" />
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="jacocoant.jar"/>
</taskdef>
<target name="get_data">
<jacoco:dump address="${server}" port="${port}" reset="true" append="false" destfile="${result.exec.file}"/>
</target>
</project>
Thanks Marc,
Please see below jacoco agent configuration:
-javaagent:/test/jacoco/jacocoagent.jar=output=tcpserver,address="remoteAddress"
Ant task:
<target name="getdata">
<jacoco:dump address="remoteAddress" port="6300" append="false" destfile="${result.exec.file}"/>
</target>
My remote server require authentication and so I can not use ant task. As per documentation jacoco does not provide any authentication mechanisms. So I tried with jacoco java API ExecutionDataClient, I am able to run and dump instrumented data for local server. Now I am trying the same for remote sever. Can you please suggest about that.
Thanks.
Jitendra Tiwari