Sachin Tiwari
Sachin Tiwari

Reputation: 150

Why is Jenkins showing NO (0%)code covered in jacoco reports code coverage summary

I am using maven as build tool. Jacoco for code coverage. Jenkins for CI. Everything is configured properly in pom.xml However, when build is successful, the code coverage report shows 0% code covered.

enter image description here

I configured fields for jacoco on jenkins as, Path to exec files: **/project_name/target/coverage-reports/jacoco-unit.exec

Path to class directories: **/project_name/target/classes

Path to source directories **/project_name/src/main/java

Inclusions: Firstly I tried with **/*Test.class, **/*Spec.class & later by keeping field blank

Just to check if my jacoco version is wrong, I even looked into this

Jacoco version too is correct.

The HTML reports too are generated properly in target

I am wondering why jenkins is not displaying

Upvotes: 4

Views: 2480

Answers (1)

Harish Gautham
Harish Gautham

Reputation: 76

This is for other people who search for similar solution...

  1. Check the size of the jacoco.exec file, it shouldn't be 0KB
  2. Make sure you stop all the JVM Gracefully
  3. Make sure while generating report you are pointing to the right source.

Upvotes: 0

Related Questions