Uncovered lines on new code sonar but jacoco covered

Sonar Quality gate failing because of code coverage. But when I checked on my system with jacoco. It is showing above 80% and lines not covered in sonar are also covered. Can anyone help me out?
Sonar Cloud Link: https://sonarcloud.io/dashboard?id=iluwatar_java-design-patterns&pullRequest=1753

Attaching jacoco reports from my system.


Hey there.

Thanks for reaching out!

We can see in your analysis logs that no JaCoCo XML report is imported for usage-cost-processor

[INFO] ------------- Run sensors on module usage-cost-processor
.....
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[INFO] No report imported, no coverage information will be imported by JaCoCo XML Report Importer

This is pretty unique to usage-cost-processor, as we see JaCoCo reports being found and imported on many other modules, like abstract-factory (which, like many of your modules, seems to get the name Java Design Patterns)

[INFO] ------------- Run sensors on module Java Design Patterns
....
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[INFO] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms

Looking at your Maven build/test, JaCoCo (the prepare-agent and report tasks) is present for abstract-factory but not usage-cost-processor

[INFO] -------------------< com.iluwatar:abstract-factory >--------------------
[INFO] Building abstract-factory 1.25.0-SNAPSHOT                        [2/157]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ abstract-factory ---
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.0:check (validate) @ abstract-factory ---
[INFO] 
[INFO] --- directory-maven-plugin:0.3.1:directory-of (directories) @ abstract-factory ---
[INFO] Directory of com.iluwatar:java-design-patterns set to: /home/circleci/project
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.6:prepare-agent (prepare-agent) @ abstract-factory ---
[INFO] argLine set to -javaagent:/home/circleci/.m2/repository/org/jacoco/org.jacoco.agent/0.8.6/org.jacoco.agent-0.8.6-runtime.jar=destfile=/home/circleci/project/abstract-factory/target/jacoco.exec
.....
[INFO] --- jacoco-maven-plugin:0.8.6:report (report) @ abstract-factory ---
[INFO] Loading execution data file /home/circleci/project/abstract-factory/target/jacoco.exec
[INFO] Analyzed bundle 'abstract-factory' with 12 classes

I won’t paste them here, but you can look in the logs yourself to see the JaCoCo tasks missing on usage-cost-processor.

I would suggest focusing on why they seem to be missing (and make sure the XML reports are getting generated for that module so they can be consumed by SonarQube).