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
2
votes
2 answers

Jacoco doesn't find Kotlin files coverage in Kotlin and Java maven project from kotlin's tests

I have project with Kotlin and Java source folders and Kotlin and Java test source folders. But when I try to check coverage, Jacoco can't find coverage for Kotlin classes. @Godin I tryed to apply build-helper-maven-plugin from your answer answer…
2
votes
0 answers

jacoco - analyzed 0 classes

I am trying to use jacoco for code coverage of my java project (maven build). This is the build section of my pom. I see that my test class getting executing with all the tests (2 of them) passing. However, Jacoco says "Analyzed bundle with 0…
Ram Viswanathan
  • 181
  • 3
  • 14
2
votes
1 answer

Jacoco Plugin for Scala Singleton Objects is covering the same Classes twice and creating a Coverage Deficit

I am using Jacoco-Maven Plugin for Scala Test Coverage, But when I run the tests I see in Index.html in Jacoco the Singleton Objects are getting Covered twice where one gives the Correct Coverage and the other gives a wrong Coverage Number. Image:
2
votes
1 answer

surefire plugin output: "WARNING: An illegal reflective access operation has occurred"

I have the following plugins configured in my maven build: org.codehaus.mojo sonar-maven-plugin 2.6
2
votes
1 answer

jacoco-maven-plugin not excluding test classes

Jacoco reports for this project contain line coverage for test classes, despite attempting to exclude tests as below org.jacoco jacoco-maven-plugin
fred
  • 1,812
  • 3
  • 37
  • 57
2
votes
0 answers

How can I to see the code coverage per each test?

Is it possible to achieve a code coverage per each single test method with JaCoCo and Maven and to see it SonarQube? I wish to see additionally by which unit test(s) a line or condition has been covered. Instead it shows me only the coverage of all…
jotregadro
  • 31
  • 1
2
votes
2 answers

How to exclude generated code from a code coverage report?

I've got the following jacoco-maven-plugin configuration: org.jacoco jacoco-maven-plugin ${jacoco.version}
Shmoe
  • 31
  • 1
  • 3
2
votes
1 answer

How to set jacoco coverage percentage to 60% at child's pom?

Can some one tell me how to set Jacoco code coverage to a certain percentage in Child's POM. I have a parent dependency which is expecting 80% coverage. I need to limit that to 60% in my child project. I am setting 0.600 under child's pom…
Sunil
  • 101
  • 1
  • 10
2
votes
0 answers

How to get code coverage of servlets using integration tests

I have been trying to get code coverage of actual development code (servlets and others) using integration tests (code coverage is not for integration tests). Tech stack: Java 1.8, Maven 3.3.9 and IntelliJ Idea 2018.3 My project structure is as…
2
votes
0 answers

Maven jacoco excludes not working possibly due to uber jar

In https://github.com/jimshowalter/architecture-enforcer, I'm trying to solve "Jacoco excludes in the pom aren't working for the pf-CDA classes, possibly due to the shaded jar. Because excludes aren't working, we can't enable the check for 100%…
Jim Showalter
  • 550
  • 3
  • 8
  • 20
2
votes
1 answer

Configuring jacoco for integration and unit test reporting in Sonarqube with Powermock

I am using Sonarqube to keep track of both unit and integration test coverage for a multi-module Maven project. This was the existing profile in the parent pom.xml that was used to generate the Sonarqube report locally before I made the…
2
votes
5 answers

Jacoco report-aggregate - Include report of aggregate project

I have a multi-module maven project. parent child1 child2 child3-report All child projects have unit tests, and child3 depends on child1 and child2. Following the pom for child3 org.jacoco
sidgate
  • 14,650
  • 11
  • 68
  • 119
2
votes
0 answers

Testing with EmbeddedKafka - Test report

I'm using EmbeddedKafka to test the integration with Kafka in my microservice. And also, I'm using jacoco for publishing the test result. Inorder to make the test run without any issue, I have to make the forkCount parameter as 0. …
Thiru
  • 2,541
  • 4
  • 25
  • 39
2
votes
1 answer

Override plugin configuration in profile

I have maven project with multiple profiles. In one profile I have plugin configuration (jacoco-maven-plugin to enforce test coverage): org.jacoco jacoco-maven-plugin
Kirill
  • 7,580
  • 6
  • 44
  • 95
2
votes
0 answers

Jacoco report : Not able to navigate to source file and see code coverage

Tools : Jacoco maven plugin Issue : I am working on a multi-module project. The project structure is described as below - Module1 Module1Test Module2 Module2Test I am able to generate the jacoco report for the Test module . The jacoco report…
Atul
  • 1,560
  • 5
  • 30
  • 75