Questions tagged [jacoco-maven-plugin]

A maven plug-in which provides the JaCoCo agent to automated tests and allows basic report creation.

This plugin lets the build process load the agent runtime in the pre-test phases, allowing additional configuration in the file, and generate test documentation in the verify phase.

Usage

The Maven plug-in can be included in your build with the following declaration:

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.7.8</version>
</plugin>

To receive a full list of goals and available parameters you can use maven-help-plugin:

mvn help:describe -Dplugin=org.jacoco:jacoco-maven-plugin -Ddetail

More Info

401 questions
3
votes
0 answers

Jacoco Report Aggregate Coverage Report issue on Sonar

I have a multi-module maven project. I am facing issues while generating the sonar report for the jacoco report-aggregate coverage. I have 2 modules (A and B) for which I want to generate the report. I have created another module…
3
votes
0 answers

With Java11 and Maven, try to avoid jacoco and surefire exit error and run jacoco test coverage on Mac

This seems to be an issue related to Mac, Java11. I am trying to run source code and target as Java8 but my runtime is java 11 Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode) Apache Maven 3.5.3…
Berlin Brown
  • 11,504
  • 37
  • 135
  • 203
3
votes
2 answers

SonarQube 8.2 Analysis shows 0 code coverage

SonarQube: 8.2.0.32929 sonar-scanner: 3.0.3.778 jacoco: 0.8.4 jdk: 1.8 mvn: 3.6.3 What are you trying to achieve I am trying to achieve code coverage by using sonar-scanner but I am getting code coverage 0 in sonarqube dashboard. What have…
3
votes
1 answer

Missing JaCoCo code coverage report on SonarQube server after analyzing Maven plugin with JaCoCo plugin configuration

Using: SonarQube Community Edition v. 7.9.1 sonar-maven-plugin v. 3.6.0.1398 jacoco-maven-plugin v. 0.8.4 I'm trying to upload the JaCoCo coverage report from my java maven project. I followed the instructions presented in this link and this…
3
votes
0 answers

Display Sonar Code Coverage with jacoco.exec file in Sonar LTS 7.9.2

Recently I have updated SonarQube 7.9.2 in which sonar.jacoco.reportPaths property has been deprecated and need to use sonar.coverage.jacoco.xmlReportPaths. I don't have JaCoCo xml report generated and I am using ant for build and JUnit. Please…
Aravind
  • 53
  • 1
  • 8
3
votes
1 answer

Jacoco Report missing

I'm trying to create a jacoco report on my project. The project is in java 12 version and the jacoco-maven-plugin is on version 0.8.5. org.jacoco
bmeynier
  • 289
  • 2
  • 12
3
votes
2 answers

How to fix unstable builds when thresholds are met?

My overall coverage is meeting the threshold, but still build is marked as Unstable. Does anyone know the reason for this? 16:53:04 [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=75, maxClass=99, minMethod=75, maxMethod=99,…
3
votes
0 answers

JaCoCo Check not failing AEM Multi-module Project build below Threshold Coverage

I am trying to configure jaCoCo check in my multi-module AEM 6.4 project. I have written Test Classes for JUnit5 Extensions which compile well. I can see report being published to my Sonar Server as well, coverage being 45.9% - Failed. When I…
3
votes
0 answers

Jacoco - Exclude package from coverage report

I have a problem with Jacoco, I try to exclude a package from coverage, this is my configuration. But, report doesn't exclude it and this problem generating a low coverage in my project. Thanks!
aamapanqui
  • 51
  • 1
3
votes
1 answer

Multiple paths in sonar.jacoco.reportpath

I have a maven Jenkins job (Jenkins version 2.105) with Jacoco and Sonar (Version 6.0) configured. The project has multiple jacoco.exec created and I need to put the path for the same under sonar.jacoco.reportpath. The code coverage comes up in…
3
votes
1 answer

SonarQube Jacoco offline instrumentation shows 0% coverage in Maven Multi Module Project

I am using Jacoco offline instrumentation as I have used PowerMockito for my test cases. Mine is Maven Multi Module Project. I am using PowerMockito 1.65 My SonarQube version is 6.7 JaCoCo generates HTML files in every module, But in SonarQube it…
Pradeep Charan
  • 653
  • 2
  • 7
  • 28
3
votes
1 answer

PowerMockito with Jacoco Code Coverage

Code Coverage with Powermockito with jacoco In my project we using powermockito, for codecoverage jacoco api. Seens we we use @preparefortest({xyzimpl.class,abcd.class}) annotation. On code coverage, xyzimpl.java code coverage is not covered. is…
KrishnaFJ
  • 155
  • 1
  • 2
  • 8
3
votes
0 answers

jacoco code coverage with integration tests and multi module project

i am trying to get jacoco working, so it reports me my code coverage of my integration tests. Currently i have this setup parent.pom -- module1 -- module2 -- module3 -- module4 -- report module 1 to 3 contains my source code, while module 4…
H3npi
  • 115
  • 3
  • 13
3
votes
1 answer

Jacoco code coverage with Sonar and maven for integration tests in separate module

I've configured my project with SonarQube and Jacoco for code coverage. Everything works well except one thing. I divided project in many maven sub modules: project (pom.xml) - |-moduleA (no pom here) | |- it (pom.xml) - integration tests for…
3
votes
4 answers

Unable to run jacoco code coverage tool

I have a maven project (link) and I want to run code coverage on it. I ran the command mvn test -Pcoverage jacoco:prepare-agent jacoco:report on the main project pom file, but the report is not generated. Instead I get a warning saying [INFO] ---…
user1918858
  • 1,202
  • 1
  • 20
  • 29