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
14
votes
5 answers

Integration Test Coverage in SonarQube from JaCoCo Maven plug-in showing 0%

We have a multi-module multi-language maven java project with coverage analysis with jacoco. The main part of the modules is backend (Java code) with a REST API and our webapp module contains the frontend (AngularJS) and the Integration-Tests in…
13
votes
3 answers

Jacoco java.lang.instrument.IllegalClassFormatException: Error while instrumenting Class

I recently moved to another computer and needed to reset all my environment. So, this tests was working before. But I didnt remember which version of Java/JDK I was using before. Well, the problem…
LMaker
  • 1,444
  • 3
  • 25
  • 38
13
votes
4 answers

Is there a way to get unit coverage percentage (eg from jacoco) on only new code?

My hypothethical scenario is this: I have run my junit tests and generated a jacoco file my git diff shows I have changed 10 lines of code Now the intersection of my git diff and the jacoco information is that 7 of the 10 lines of code changed are…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
12
votes
2 answers

Maven Jacoco Configuration for multi-module projects

I was trying to generate code coverage reports using jacoco plugin in maven for a multi module project that I was working on. I added the following in my parent pom.xml within the build tags. org.jacoco
John
  • 2,445
  • 2
  • 17
  • 25
11
votes
1 answer

How do I generate a JaCoCo report for a JAR file?

We are trying to report code coverage of tests against a pre-packaged JAR file using JaCoCo. To do this we start the JAR file using java -jar with the additional…
Peter Becker
  • 8,795
  • 7
  • 41
  • 64
11
votes
2 answers

How to check minimum code coverage for multi-module maven project with jacoco?

I want to use jacoco maven plugin for checking minimum level of code coverage during build process using 'check' goal. For one-module project everything works fine. But for multi-module I want to check average level of code coverage from all…
10
votes
5 answers

Jacoco maven plugin clogs up console with Exceptions-java.lang.IllegalStateException: class is already instrumented

I am working on sonar code coverage using Jacoco plugin and using power mock mockito combination to write JUnit test cases, while all goes well with the build when I run mvn clean install but the console shows a very very long stack trace chain…
Deepak S
  • 1,544
  • 3
  • 15
  • 33
10
votes
2 answers

How can I exclude files of the Code Coverage of SonarQube using JaCoCo maven plugin

I've got a big issue with the integration of JaCoCo maven plugin for the code covering of SonarQube 6.0. I've got a multi-module Maven project lets say : master |--core |--web |--process in the master pom.xml, I've setted a reporting…
Gilles Bodart
  • 594
  • 1
  • 10
  • 27
10
votes
1 answer

Exclude groovy slf4j logging from condition coverage in Sonar with Jacoco

We are using SonarQube 5.1 with Jacoco maven plugin 0.7.4, and all of our slf4j logging statements such as log.debug('Something happened') show that only 1 of 2 branches are covered. I understand that this is because slf4j internally does an if…
Egor
  • 1,622
  • 12
  • 26
9
votes
1 answer

ERROR in jacoco check - The parameters 'rules' are missing or invalid

This is the error I get when running mvn jacoco:check for a maven application. Due to that, the report is not generated. [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:check (default-cli) on project Netflix: The…
Bu5to
  • 93
  • 1
  • 1
  • 3
9
votes
1 answer

Code Coverage Kotlin and Java together using Maven - Jacoco

I am using Maven plugin to generate the code-coverage with Maven Plugin as below: org.jacoco jacoco-maven-plugin
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
8
votes
2 answers

How to exclude and include properly classes, packages and jar classes, lib from the jacoco report (Instrumentation offline)

I am using JaCoCo code coverage, but the report is including classes from jar, lib. (Offline Instrumentation, Maven) I solved the problem with the offline configuration since "aspectj-maven-plugin" was changing the class files, and also now I…
Didier R. G.
  • 437
  • 5
  • 11
8
votes
3 answers

jacoco : Cannot exclude classes

I have a maven project and I want to use jacoco for code coverage. Here is the relevant section of my pom org.jacoco jacoco-maven-plugin
AbtPst
  • 7,778
  • 17
  • 91
  • 172
7
votes
2 answers

JaCoco MVN unknown block type

So I'm using the JaCoco maven plugin to automatically generate code coverage reports so I can then send them to codecov to display on GitHub. All of a sudden I'm getting a build failure from JaCoco saying "Unknown block type". This wasn't happening…
Ryan
  • 727
  • 2
  • 14
  • 31
7
votes
1 answer

How to specify the specific packages for the 'jacoco-check'?

My project is built using Maven. I use the 'Jacoco' plugin to perform quality checks. For a project I would like to check the test coverage on line basis. I would like to check the line coverage only for only 3 packages. How can I specify this…
tm1701
  • 7,307
  • 17
  • 79
  • 168
1
2
3
26 27