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

Jacoco lost test. Coverage always 0

Jacoco plugin lost JUnit tests, report always 0% but the test exists. I think the problem is my pom.xml. Help me find the mistake. Pom.xml on GitHub Perhaps its conflict with checkstyle plugin? Part with Jacoco setting:
Pavel
  • 2,005
  • 5
  • 36
  • 68
4
votes
1 answer

Jacoco is not able to cover a class containing only static methods

Jacoco is not able to cover a class containing only static methods. I did not instantiate the class in the test class rather directly called the static method to test. public class DateUtil { final static String datePattern = "EEE…
Nilotpal
  • 3,237
  • 4
  • 34
  • 56
4
votes
0 answers

maven jacoco not generating code coverage for Integration tests

I have a multi-module java spring boot project. Here is my project structure - pom.xml (root) - war (project) --- pom.xml --- src/.../SBMainApplication.java - api (project) --- pom.xml --- src/../Controller1.java --- test/unit/ ---…
4
votes
0 answers

Eclipse RCP plugin code coverage with Jacoco and Tycho surefire

I have an Eclipse RCP application that is built via Maven using Tycho. It has some tests that are located in plugin fragments, so each plugin with operational code has its own fragment with the tests inside. The tests are executed during the maven…
Cecilya
  • 519
  • 1
  • 5
  • 20
4
votes
1 answer

Pictures are not appearing in Jacoco coverage report (neither in Index.html nor in VSTS)

I'm setting up Jacoco coverage for a Maven project. I want to publish this coverage in VSTS. I successed to get coverage correctly and it is published for all submodules of my project, but pictures are not appearing (neither in Index.html file…
4
votes
2 answers

The forked VM terminated without properly saying goodbye. VM crash or System.exit called?

I have configured maven-surefire-plugin and jacoco plugin to generate the junit code coverage report. However, I am getting 2 different error in 2 different scenarios. Can you please have a look on below errors and help me? Any help is really…
4
votes
1 answer

JaCoCo coverage is missing

I've been working on this for hours, and every solution I've tried that I've found online makes no difference. I have a project which is written in Kotlin. I have the Kotlin plugin installed on my sonar server. I am using JaCoCo plugin to generate…
4
votes
1 answer

Jacoco Code Coverage Report Shows 0 coverage in Jenkins

Jacoco plugin showing 0% coverage in jenkins reports but when I ran the same command in local system, jacoco generates reports properly. I'm using following command: mvn -s xyz/settings.xml -f xyz/xyz/pom.xml clean install…
Jay
  • 1,257
  • 2
  • 11
  • 16
4
votes
1 answer

Does cobertura support java 8 ?Because i want to use java8 labmda expression and it is giving me an error

I am new Cobertura I have written Test case and I use Lambda expression in coding and it is giving me an error how to solve this issue. I search on google and came to know that Jacoco support Java8. But how to insert jacoco plugin as Cobertura …
4
votes
1 answer

No JaCoCo analysis of project coverage can be done since there is no class files

I am using Bamboo, SonarQube, and Maven plugin for generating the Jacoco Report in SonarQube. It is generating jacoco.exec file but how to display reports in SonarQube? Following plugin i am using '
Naveen Reddy
  • 43
  • 1
  • 7
4
votes
2 answers

How to exclude a class from Jacoco coverage?

I want to use Jacoco in a way so that it excludes a Sample.java class from the overall coverage. To achieve that I have included within prepare-agent goal in maven pom.xml Jacoco plugin:
meallhour
  • 13,921
  • 21
  • 60
  • 117
4
votes
0 answers

Getting error "Line must be null or greater than zero (got 0)" during a sonar build using jacoco

I have upgraded my sonar java plugin to 3.7. We use inbuilt jacoco plugin to do the code coverage. We use the maven target org.jacoco:jacoco-maven-plugin:prepare-agent and sonar:sonar to get a sonar build triggered from jenkins job. However post the…
nishat
  • 947
  • 2
  • 8
  • 15
4
votes
1 answer

Jacoco coverage of unit test code

I'm converting an ANT build to Maven. I don't use Sonar. In Maven, Jacoco doesn't seem to report about coverage of the unit tests themselves, while ANT does. I've been trying to get this for my Maven build as well, but I haven't been able to find…
jqno
  • 15,133
  • 7
  • 57
  • 84
3
votes
1 answer

Facing Jacoco Method too large Error when running

Facing Method too large Error from jacoco for a method in the drools library, how to resolved this? I also tried adding **DRL6Lexer.class to the exlucdes in jacoco but it didn't work. How else can I resolve this…
Mike Reddington
  • 192
  • 2
  • 15
3
votes
0 answers

Jacoco aggregate report is generating Exec file instead of XML

We have a multi-module maven project. We are using java8. -Parent -- Child 1 -- Child 2 -- Coverage-Report All projects have unit test cases, those all are working good and have more than 85% of coverage. Parent pom.xml file has jacoco-profile and…
Vikrant Korde
  • 315
  • 2
  • 11