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.exec is not getting created for all modules in multi-module maven project

We are using JaCoCo for unit test code coverage in our multi-module maven project and able to get the coverage info(jacoco.exec) for most of the modules where unit tests are available. The only issue that i'm seeing is, jacoco.exec is not getting…
David
  • 31
  • 3
3
votes
1 answer

JaCoCo Memory Allocation after Job is terminated

Last week I spotted one curious moment while working with Jenkins. In my multimodule project I am using Jacoco test coverage and Jacoco-plugin in Jenkins. I start some job in my Jenkins, when it comes to the test phase, Jacoco process will be…
t_sologub
  • 855
  • 2
  • 15
  • 26
3
votes
0 answers

jacoco-maven-plugin/Sonar Scanner - "Coverage by Test" info not present in merged jacoco report (jacoco-overall.exec)

I have been trying to solve an issue with combined reports coverage for some time now, and I can't seem to find any useful information that's relevant to my particular issue. Implementation Details: SonarQube (v5.4) jacoco-maven-plugin…
3
votes
1 answer

jacoco only shows coverage for classes in the same module

I have a somewhat large multi-module Maven project. I have the unit tests in each module being processed by Jacoco. I have a separate child module doing "merge" and "report-aggregate", and this appears to be generating data. I'm even using the…
David M. Karr
  • 14,317
  • 20
  • 94
  • 199
3
votes
0 answers

JaCoCo check goal for integration tests

My belief is that JaCoCo Maven plugins check goal does not support integration tests in a multi module project (where the integration tests are in a different module to the code under test). I have a project with the following structure: service ├──…
markdsievers
  • 7,151
  • 11
  • 51
  • 83
3
votes
3 answers

jacoco merge goal can't find data files for child modules

I have a large Maven multiproject build with PowerMock-based unit tests. I'm generating a "target/jacoco.exec" in the child modules, with plugin configuration in the overall parent pom for the child modules. I have an additional child module that…
David M. Karr
  • 14,317
  • 20
  • 94
  • 199
3
votes
2 answers

How to generate HTML report from jacoco.exec?

We have a Maven project which has submodules. There is one parent pom.xml and each and every sub projects are made into a war file. Each and every submodule has unit test cases and reports generated from Jacoco. The existing reports show unit test…
svs teja
  • 957
  • 2
  • 22
  • 43
3
votes
0 answers

JaCoCo integration with gwtmockito

I am using JaCoCo maven plugin for the test coverage reports. It works with MockitoJUnitRunner, but when I use it with tests that run with GwtMockitoTestRunner (annotated @RunWith(GwtMockitoTestRunner.class)) I always get zero coverage. In the…
J. Soltes
  • 31
  • 2
3
votes
2 answers

jacoco shows lines as not covered though the lines get executed while running the code

I have the below lines of code of which are indicated as not "executed" by Jacoco. But when I debug the test case it does execute those lines. Below are the test cases I wrote. @PrepareForTest({MessagingAdapterFactory.class,…
AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
3
votes
1 answer

Missing Jacoco Code Coverage and IncompatibleClassChangeError

I have a maven project with some Arquillian Tests (Drone/Graphene Tests included). When I build my project using maven all my Arquillian Tests that use Graphene and Drone or Warp will fail with following exception Running…
3
votes
0 answers

How can I filter out packages from the JaCoCo Maven scope?

I'm working on code coverage for a Java library. It's a SOAP/REST client. The client has several packages dataTypes.generated. for the generated types for connecting to the server side. For working with the client there is a translation layer to…
Raystorm
  • 6,180
  • 4
  • 35
  • 62
3
votes
0 answers

Selenium test coverage in jacoco report 0%

I am trying to get tests runnning with maven failsafe to show up in thwe jacoco report, I have split the unit and integration tests and all my tests pass and the verify runs fine. I get a created integration test report in my target directory and…
3
votes
1 answer

Jacoco code coverage affected by AspectJ compile time weaving

I am using maven to build my current project. I have Jacoco for code coverage and aspectJ for compile time weaving for my aspects. Right now I am facing the issue where aspectJ weaved code affecting the code coverage. It is 100% when we don't weave…
3
votes
2 answers

How to have the Maven build wait for the Jetty server to start in forked mode before running the integration tests?

I have a report for the code coverage by the integration test. I do have integration tests, and these are run successfully in the Maven build. When I click on the "Sessions" link in the top right corner of the HTML report I can see my test classes…
Stephane
  • 11,836
  • 25
  • 112
  • 175
3
votes
0 answers

Capturing logging entries on code coverage

I'm using Maven Surefire plugin to run my project's unit tests and Jacoco for code coverage. I have a strict coverage criteria in my project but my problem is that logging level specific lines are not captured by the Jacoco and messing up with my…
Omri
  • 1,058
  • 3
  • 14
  • 26