war, tomcat, dockerize, jacoco agent

48 views
Skip to first unread message

Askar Musakunov

unread,
Dec 27, 2023, 2:33:06 PM12/27/23
to JaCoCo and EclEmma Users
Hey Jacoco Support team, 

I have a dockerized war app that I want to run jacoco agent with it. 

So far I am able to generate the jacoco.exec on the docker container. with the size of 670K.

When I run mvn \
  org.jacoco:jacoco-maven-plugin:0.8.8:report \
  -Djacoco.dataFile=target/jacoco.exec

it generating jacoco.hml file, however the HTML file says No class files specified. and is empty report. 

here is Dockerfile. It builds successfully. 
FROM tomcat:9.0
EXPOSE 8080
COPY /target/bank##2.0.11.war /usr/local/tomcat/webapps/
COPY /target/classes/application.properties /usr/local/tomcat/conf/digitalbank.properties

# Copy the JaCoCo agent into the container
COPY /target/jacocoagent.jar /usr/local/jacoco/jacocoagent.jar

# Set the JAVA_OPTS environment variable to include the JaCoCo agent
ENV CATALINA_OPTS=-javaagent:/usr/local/jacoco/jacocoagent.jar=includes=*

HEALTHCHECK CMD curl -fail http://localhost:8080/bank/api/v1/health || exit 1



What am I doing wrong? Any help is appreciated. 
 
Reply all
Reply to author
Forward
0 new messages