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
5
votes
1 answer

Couldn't able to generate coverage report by aggregating all the modules

Error: [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.5:report-aggregate (report-aggregate) on project distribution: Unable to parse configuration of mojo org.jacoco:jacoco-maven-plugin:0.8.5:report-aggregate for parameter…
Manju
  • 145
  • 2
  • 10
5
votes
2 answers

JaCoCo (Offline Instrumentation) in instrument analyzes the entire pom.xml. But I need only the tests part

Basically I need jacoco only instrument the tests part, but is instrumententing the entire pom.xml, and the report came with everything (Data from “oracle.jdbc.driver”, “com.mysql.jdbc”… etc.) I've been trying for a couple of days with almost…
Didier R. G.
  • 437
  • 5
  • 11
5
votes
1 answer

Running jacoco check goal with maven 3.5

My jacoco plugin configuration in a pom likes below org.jacoco jacoco-maven-plugin 0.7.5.201505241946
tuk
  • 5,941
  • 14
  • 79
  • 162
5
votes
1 answer

Exclude files in Jacoco Coverage Report

I have been trying to remove certain files from the generated coverage report. I tried below things: org.jacoco jacoco-maven-plugin 0.8.1
A_G
  • 2,260
  • 3
  • 23
  • 56
5
votes
1 answer

Sonar + Jacoco + Junit 5 : No information about coverage per test

I am trying to get coverage per test feature working with Sonarqube 7. I am using jacoco-maven-plugin and my tests are running with JUnit 5. I successfully managed to get global Coverage on Sonarqube dashboard, but I would like to go deeper by being…
rico
  • 1,843
  • 2
  • 24
  • 41
5
votes
1 answer

How to merge 2 jacoco coverage reports (.exec file) irrespective of maven life cycle

I have a jacoco plugin in my pom to get junit test coverage and I am dumping another report from a different server. How to merge these 2 jacoco coverage reports (.exec file) irrespective of maven life cycle.
5
votes
0 answers

code coverage for Jenkins shared Groovy library with jacoco

I have a shared groovy library that provides some steps (in vars folder) for a Jenkins pipeline. For the steps I have groovy unit tests in place and want to calculate code coverage with them. I already have setup jacoco successfully and get coverage…
5
votes
3 answers

Jacoco is not showing coverage for PowerMockito classes

We are using Jacoco and eclemma for test case coverage. For the classes that are not using PowerMockRunner we are getting coverage properly in both.For the classes that uses PowerMockRunner we are facing issue with coverage like it shows 0 %…
Pradeep
  • 1,947
  • 3
  • 22
  • 45
5
votes
2 answers

How can I filter a few methods to be analysed for code coverage

I using Jacoco as code-coverage plugin configured inside my pom.xml. I want to test and analyse coverage of only a few methods from my class file and want to show coverage percentage accordingly for them only. But as jacoco analyse whole file it…
Deepak S
  • 1,544
  • 3
  • 15
  • 33
5
votes
0 answers

Maven Build Issues : Reading jacoco.exec file

We have several different faults with our jacoco.exec file, see the Error types below. Can you please help us with this problem, we have at least 25% build failures due to Jacoco. Error Type 1: 09:18:17 [INFO]…
5
votes
3 answers

Maven multi module project with separate tests module - Code Coverage?

I have a maven multi module project. root: moduleA/ # no unit tests moduleB/ # no unit tests moduleC/ # no unit tests tests/ # All unit tests, since depends on modules A, B and C All tests are in single module called…
nishant
  • 955
  • 2
  • 11
  • 27
5
votes
2 answers

Multi Module Maven Project Code Coverage Issue on Sonar

I have a question related to multi module maven project with JaCoCo and SONAR. I have a parent and 3 child modules. parent |-child1 - pom.xml |-child2 - pom.xml |-child3 - pom.xml |-pom.xml I include the JaCoCo plugin in the parent pom.xml. When I…
4
votes
1 answer

Using quarkus-jacoco for test that aren't annotated with @QuarkusTest

According to Quarkus Documentation, to have JaCoCo considering test classes that aren't annotated with @QuarkusTest, the only thing we need to do is to configure the jacoco plugin to execute the goal prepare-agent. I've added that, the same as the…
4
votes
1 answer

Code coverage is not showing up in SonarCloud after Azure devops build

We have a multi module Maven project and using JaCoCo for code coverage analysis. I prepared the pom file to run the test cases and pick up the code coverage. Below is my pom.xml with JaCoCo and other plugins added and in Azure Devops build am…
4
votes
2 answers

Why does only instruction coverage appear in the JaCoCo Jenkins report?

I have a Java project for which I want to see automated test coverage in Jenkins builds. For this purpose I modified the files as shown below. Jenkinsfile: pipeline { agent any stages { stage("Test") { steps { …
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325