Connection refused while publishing jacoco coverage from app container to host machine in Jenkins

121 views
Skip to first unread message

Pankaj Bharambe

unread,
Oct 21, 2021, 12:37:29 PM10/21/21
to JaCoCo and EclEmma Users
Hi, 
I am running a Spring Boot App inside a docker container. From container I am running Integration Test and using Jacoco maven plugin to publish coverage. I have below arguments for Jacoco in my entrypoint.sh file -

-javaagent:./target/jacoco-agent/org.jacoco.agent-runtime.jar=destfile=jacoco.exec,append=true,output=tcpserver,port=9100,address=*

Below is my docker-compose.yml file -

services: 
   employee-service: 
       build: 
          context: . 
          dockerfile: Dockerfile-IT 
          container_name: es 
          ports: 
              - "9900:9900"  
              - "9100:9100" 
              - "8800:8800" 
          expose: 
                - "9100"
           volumes:
                - ./target/jacoco-agent/org.jacoco.agent-runtime.jar:/jacoco-agent.jar

I am able to run successfully on my local machine but when I am trying to build from Jenkins I am getting

[INFO] Connecting to localhost/127.0.0.1:9100 

 [INFO] Connection refused (Connection refused) 

 [INFO] Connecting to localhost/127.0.0.1:9100 

 [INFO] Connection refused (Connection refused) 

 [INFO] Connecting to localhost/127.0.0.1:9100

Not sure what settings I am missing here. Can some one please help me on this.


Jacoco Version : 0.8.2

Java Version : Java 8

Message has been deleted

Pankaj Bharambe

unread,
Oct 21, 2021, 12:43:16 PM10/21/21
to JaCoCo and EclEmma Users
I have also tried with below Jacoco parameter but still same issue.

-javaagent:jacoco-agent.jar=destfile=jacoco.exec,output=tcpserver,port=9100,address=*

Pankaj Bharambe

unread,
Oct 22, 2021, 1:18:23 PM10/22/21
to JaCoCo and EclEmma Users
Hello, 

Can some one please look into and give the direction how to solve this issue. I am stuck here. 

My PR build is failing in jenkins because of no coverage dump. 

Reply all
Reply to author
Forward
0 new messages