how to dump coverage file and generate report for tcpserver mode by maven

1,933 views
Skip to first unread message

sunyi...@gmail.com

unread,
Sep 3, 2015, 2:20:40 AM9/3/15
to JaCoCo and EclEmma Users
What I have done is
1. Start app with jacoco agent with tcpserver output on certain port
2. Access some URL on app
3. Use ant script to dump coverage exec file by specifying ip/port/etc
4. Use ant script to generate report based on exec/class/source

My question is for step 3 and 4, is there any way to use maven to dump coverage file and generate report? Is there any pom example?

Thanks.

sunyi...@gmail.com

unread,
Sep 3, 2015, 2:53:39 AM9/3/15
to JaCoCo and EclEmma Users, sunyi...@gmail.com
OK. I think I figure it out by myself :) Thanks.

mvn jacoco:dump

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jacoco</groupId>
<artifactId>test</artifactId>
<version>0.0.1</version>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6-SNAPSHOT</version>
<configuration>
<address>10.244.42.227</address>
<destfile>e:/jacoco/abc</destfile>
<port>10001</port>
<reset>false</reset>
<append>true</append>
</configuration>
<executions>
<execution>
<phase>post-integration-test</phase>
<goals>
<goal>dump</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages