406 questions
0
votes
1
answer
66
views
Jacoco produces truncated xml and csv file
We are using the Jacoco maven plugin to generate the code coverage for some Quarkus project. It has worked fine so far, but recently we have had some occurrences of an intermittent issue on some of ...
0
votes
0
answers
54
views
Can I exclude classes from Jacoco Report via maven pom configuration when I use quarkus-jacoco?
I know I can exclude classes from the Jacoco report via the application.properties with quarkus.jacoco.excludes but is there a way to exclude it with the configuration you can set via jacoco maven ...
0
votes
0
answers
60
views
Jacoco Report missing while executing mvn clean install command
I'm trying to create a jacoco report on our project The project is in java 17 version and the jacoco-maven-plugin is on version 0.8.8.In the target folder the jacoco.exec file gets created. But the ...
0
votes
0
answers
30
views
Jacoco Aggregate Report Not Showing the Junit Coverage for Submodule classes where test classes present in Main module
ParentModule - POM
MainModule - POM - Few Classes and (All Junits - MainModule + SubModule)
SubModule - POM - All Service Classes (No Junits)
SonarQube Server shows Junit test coverage for Mainmodule ...
0
votes
0
answers
114
views
Is there a way to exclude classes with same package name, but are present in different folders from JaCoCo code coverage report?
This is my folder structure:
- src
- main
- java
- com.chintan.project
- src-gen
- com.chintan.project
Is there a way to exclude the classes of package com.chintan.project which ...
0
votes
1
answer
291
views
Child module CCReport43F6D5EF not found when using azure pipelines task Maven@4
We are migrating to from Maven@3 task to Maven@4 see here. This works fine for most repositories, except for the multi model repository. This give me then the following error:
[ERROR] [ERROR] Some ...
-1
votes
1
answer
1k
views
JaCoCo always generates aggregate report in a non-module project, won't display coverage in Maven Site
I have a single Java 11 library (jar) project whose Maven pom refers to a parent pom for common properties and configuration. There are no submodules and the parent pom doesn't have any submodules. ...
0
votes
1
answer
404
views
How to exclude certain classes form code coverage calculations using jacoco?
I am trying to instrument code coverage for my Quarkus application.
When running mvn clean install everything works fine and code coverage is shown as expected and the classes are excluded.
But when ...
1
vote
0
answers
496
views
Zero percent test coverage after upgrading to Springboot 3
we have recently started upgrading our systems to Springboot 3.
For some reason, all my Junits are showing a Test coverage of 0% in sonarqube whereas the threshold to pass the pipeline build is 80%. ...
1
vote
1
answer
1k
views
Kotlin 1.9.2, jdk 21 (Spring boot) Jacoco (plugin 0.8.12) is complaining about missing branches
I have run into a jacoco code coverage issue where it complains about missing branches for the kotlin coroutines function withContext(Dispatchers.IO) event though all branches are covered. Nothing ...
0
votes
1
answer
767
views
Sonarqube code coverage remains 0% after configuring Jacoco
I have followed the instructions on Jacoco docs and soanrqube docs.
I have my sonar server running on a self hosted runner. I have left the param sonar.coverage.jacoco.xmlReportPaths on Sonar UI empty ...
0
votes
1
answer
369
views
Jacoco issue in quarkus:dev after Quarkus upgrade from 2.16.12 to 3.8.3
I just migrated quarkus from 2.16.12 to 3.8.3 (java 17) and the output of quarkus:dev shows now numerous java.lang.ClassNotFoundException: org.jacoco.agent.rt.internal_aeaf9ab.Offline
End of the ...
0
votes
0
answers
56
views
Get control flow information with JaCoCo
Looking for a way to retrieve control flow information, such as local variables and their values and which instructions/branches were executed for the tested methods using JaCoCo (0.8.11). I am ...
0
votes
0
answers
120
views
Unable to generate code coverage for integration test module using jacoco
I have a maven project with the attached directory structure.
It contains a parent.pom and two modules.
plugin
1.1 It contains the actual source code inside src/main
1.2 It contains the unit test ...
1
vote
0
answers
201
views
Maven surefire fails with ClassNotFoundException: InPluginProcessDumpSingleton
After upgrading to openjdk 17, test cases are failing with error
Exception in thread "closer-shutdown-hook" java.lang.NoClassDefFoundError: org/apache/maven/plugin/surefire/booterclient/...
0
votes
1
answer
275
views
Jacoco plugin for component tests
I have project structure goes like this
myProject
app
module1
submodule
pom.xml
pom.xml
automation
component-tests
pom.xml
pom.xml
...
0
votes
0
answers
486
views
Jacoco maven plugin with maven surefire plugin
I'm trying to generate coverage reports for my integration tests using Maven Surefire Plugin and Maven Jacoco Plugin. According to the documentation, <forkCount> cannot be set to zero. However, ...
4
votes
3
answers
4k
views
Azure DevOps "Code Coverage" view changes after pipeline run finished
I do use PublishCodeCoverageResults@2 task in my Azure DevOps pipeline
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: '$(System....
0
votes
0
answers
373
views
Jacoco report is not generate with jmockit argline of surefire plugin
I created a simple spring-boot application to demonstrate the issue after I faced a similar issue in my product code and explained the problem using the Dummy project.
I used testNg for writing unit ...
4
votes
1
answer
11k
views
Adding "-Xshare:off" JVM arg break jacoco-maven-plugin setup
I'm trying to get rid of the following warning message:
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
It appears ...
2
votes
0
answers
6k
views
Jacoco 0.8.8 with maven having zero code coverage with JDK17 and Sonarqube 9.9.2.77730
I am upgrading my spring boot microservice from Java11 to Java17, service build and run successfully with use of maven. I have added jacoco-maven-plugin plugin for unit test cases coverage but when I ...
-1
votes
1
answer
719
views
SonarQube Reading Becomes 0 after upgrading from Java 8 to 11
I recently upgraded my project from Java 8 to 11. For the dependency of Jacoco, i upgraded jacoco-maven-plugin from version 0.7.6.201602180812 to 0.8.7
After that, my Sonar code coverage becomes 0. ...
0
votes
0
answers
2k
views
jacoco-aggregate give an empty report
I am trying to do a jacoco-aggregate to send it to sonarqube according to this post:
https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format/12151
...
0
votes
1
answer
282
views
how to integrate a test coverage reports in maven site for a multi modules project?
I would like to add a coverage report in my maven site website in the case of a multi-modules project.
I found how to have an aggregated coverage report in a module created just to for that. see .
But ...
0
votes
0
answers
133
views
jacoco - Generate Report on external maven module with tests into an application
USE CASE
I have developed a spring-shell based maven module apim-library.
And then I developed an application apim-cli which has apim-library as a dependency and only the Application class with main.
...
2
votes
1
answer
2k
views
Jacoco can not find classes directory in multi-module maven project and generates empty html report
In my multi-module project I have a code and tests in separate modules. When I run maven command 'mvn clean install -DskipTests=false', jacoco.exec file is generated in test module but Jacoco ...
1
vote
0
answers
899
views
Jacoco index.html file is not generating coverage report for Maven testing without Spring boot/Sonar and showing "No class files specified" message
Appended Jacoco plugin by referring to Karate document's POM.xml under ** Code Coverage using Jacoco section**. However, the coverage reports are not getting generated for feature files mentioned in ...
1
vote
1
answer
242
views
Separate java projects with jacoco code coverage reports are generated separately using maven. Consolidated report generated is blank
Having separate java projects (non-multi module projects) with jacoco code coverage reports are generated separately using maven. Each one having its own target\jacoco.exec coverage file and Html ...
0
votes
1
answer
271
views
Jacoco + Mockito: NoClassDefFoundError: com.foo.Foo$MockitoMock$yT0N0ogW (initialization failure)
I have a project using jacoco-maven-plugin + maven-surefire-plugin + Mockito:
There is nothing special with configuration:
<plugin>
<groupId>org.apache.maven.plugins</...
2
votes
0
answers
1k
views
Jacoco Plugin not working After upgrading to Spring Boot 2.7.10
I am trying to take out sonar coverage of my code but the coverage is coming as 0 %. Earlier, tests were also coming as 0 , but it got resolved after adding junit-vintage-engine library. But the code ...
0
votes
1
answer
692
views
Jacoco and Sonar scanning giving different results
So when I execute mvn clean verify my code coverage is 64% for lines coverage and 62% for branch coverage. But in sonarqube my code coverage is 70%:
Where is that difference coming from? I do not ...
0
votes
1
answer
121
views
surefile plugin maven shows zero tests
I am running a maven project and everything works fine except for code coverage reports . I am using surefire plugin and jacoco. Surefire plugin shows tests as 0 and codecoverage in jacoco report also ...
1
vote
1
answer
456
views
Need to exclude AspectJ closure classes from Jacoco coverage
We need to use AspectJ compile time weaving and that is creating the AjcClosure classes. Somehow the package weaving is not working for us. We need to exclude these AjcClosure classes from the ...
1
vote
1
answer
411
views
Maven compile works, but mvn install doesn't
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.7.1:deploy (package-server) on project my-service: Cannot invoke "java.io.File.getCanonicalPath()" because "...
0
votes
2
answers
2k
views
How to get code coverage of Rest Assured testcases for my rest endpoints developed in Spring boot?
I am trying to generate jacoco code coverage report for my restassured testcases pointing to the rest end points. I am using springboot application.
My controller class looks like :
@RestController
...
1
vote
0
answers
1k
views
How does jacoco-report-aggregation generate the current project coverage report in gradle
My project is divided into multiple modules according to functions.
- rain
- rain-common
- rain-service
- rain-application
rain-application Depends on rain-common and rain-service, is a spring-...
0
votes
1
answer
2k
views
jacoco is not picking up the report path correctly
Our report generation was working fine before we made some changes. Now, I am not at all able to make it work, I have tried all solutions which I can find.
This is our older code :
<...
2
votes
3
answers
2k
views
jacoco configuration for multi module is not working
There is something strange going on with my jacoco configuration and I am not able to figure it out. I have visited multiple threads on stack overflow and other platforms and tried many thing, but ...
0
votes
1
answer
762
views
Default constructor coverage issue in jacoco [closed]
I am using jacoco in my spring boot project. My issues is that compiler generate default constructor and jacoco gives coverage issue for this default constructor, how can I exclude this default ...
2
votes
0
answers
203
views
Jacoco missing coverage when test is created
I have a project with spring-boot 2, JUnit 4, jacoco 0.8.6 and I use maven to run unit test, I have the following class:
@Component
public class AccountVOValidator implements FormValidator<...
0
votes
1
answer
376
views
How to exclude generated code from jacoco coverge report?
I have a maven project and the below step is mentioned right after executing surefire tests(for JUnit) and failsafe (for Integration tests). However, I am not able to exclude the files from generated-...
5
votes
2
answers
2k
views
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 ...
4
votes
0
answers
729
views
How to get code coverage on code for which the tests are in another module?
I have a maven module containing code but no tests. Tests are in another module.
code-module
test-module
I use JaCoCo to report about the code coverage, but it seems that no JaCoCo report is ...
0
votes
0
answers
888
views
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test)
I am trying to run some tests and generate a JaCoCo coverage report on a project and keep getting this error.
Here is my error log:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-...
3
votes
1
answer
6k
views
Jacoco code coverage report showing wrong
When I run individual test classes, it shows 100% coverage where as when I taken maven build for whole project then Jacoco report showing wrong coverage percentage for many classes. Is there a way to ...
1
vote
0
answers
111
views
What do Attributes of Maven plugins mean (jacoco:report-aggregate)
Example 1:
jacoco:report-aggregate says:
Attributes:
* Requires a Maven project to be executed.
I've stumbled trying to use the "report-aggregate" goal, as it works only if unit tests are ...
2
votes
1
answer
317
views
Maven - why does running a build of multiple packages result in a different result?
Let's say I have a project with 2 modules, and 3 pom.xml files (1 for Module A, 1 for Module B, 1 parent pom.xml)
I've added the following plugin that verifies the code coverage diff between my ...
1
vote
1
answer
2k
views
Getting error Error injecting: org.jacoco.maven.AgentMojo while maven build
I am trying to build a maven project but its giving me below error.
java.lang.NoClassDefFoundError: org/jacoco/core/runtime/AgentOptions
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0....
1
vote
1
answer
4k
views
Jacoco 0.8.7 showing code coverage as zero
I am seeing code coverage as zero in jenkins plugin. I am using Jacoco 0.8.7 in client server mode. Client is Jenkins and server(jacoco agent jar is present here) is a VM. This was not happening when ...
2
votes
1
answer
4k
views
JaCoCo Maven plugin generate report in XML format
I am using maven-jacoco-plugin for generating the test coverage. Version used is 0.8.7.
When running the mvn test command, it's generating the report in exec format.
<plugin>
<groupId>...