Hi,

I am trying to get code coverage for my maven project using jacoco agent. 
My server code and test code is separate code bases. So I thought jacoco 
agent is helpful in getting the code coverage.

For that I downloaded the jacoco agent(jacoco-0.8.5.zip 
<http://search.maven.org/remotecontent?filepath=org/jacoco/jacoco/0.8.5/jacoco-0.8.5.zip>)
 from 
here : https://www.jacoco.org/jacoco/

Jar is added into the dev code server and also added java arguments like 
below:

-javaagent:lib/org.jacoco.agent-0.8.1.jar=destfile=./coverage/jacoco.exec,output=tcpserver,address=*,port=6400
 
\

Restarted the server and make sure 6400 is upon running with jacoco agent.

In my test code, in pom file I added the code like below to generate the 
coverage report. But I am getting an error saying connection refused like 
below. Can some one Pl help me in fixing this issue and generating the 
coverage report

[INFO] Connecting to server name
[INFO] Connection refused (Connection refused)

<plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.5</version>
            <configuration>
               <address>provided the server address here</address>
               <destfile>coverage/jacoco.exec</destfile>
               <port>6400</port>
               <reset>false</reset>
               <append>true</append>
            </configuration>
            <executions>
               <execution>
                  <id>jacoco-initialize</id>
                  <goals>
                     <goal>prepare-agent</goal>
                  </goals>
               </execution>
               <execution>
                  <id>jacoco-dump</id>
                  <goals>
                     <goal>dump</goal>
                  </goals>
               </execution>
               <execution>
                  <id>jacoco-check</id>
                  <phase>test</phase>
                  <goals>
                     <goal>report</goal>
                  </goals>

               </execution>
               <execution>
                  <id>jacoco-report</id>
                  <phase>test</phase>
                  <goals>
                     <goal>report</goal>
                  </goals>
               </execution>
               <execution>
                  <id>jacoco-instrument</id>
                  <phase>test</phase>
                  <goals>
<!--                     <goal>instrument</goal>-->
                         <goal>report</goal>
                  </goals>
                  <configuration>
                     <skip>false</skip>
                  </configuration>
               </execution>
            </executions>
         </plugin>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/1e8d2335-846f-4a8a-9837-4926f8ead98d%40googlegroups.com.

Reply via email to