Description:
I am encountering an issue with JaCoCo coverage in my Maven multi-module project, which consists of two microservices: Module 1 (named "api") and Module 2 (named "core"). Both modules are developed using Quarkus and contain source (src) and test (test) directories.
Project Structure:
parent pom.xml
|
|
-----api (Module 1)
| |
| -----src
| | |
| | -----main
| | ||
| | |-----java
| | |
| | -----test
| |
| |
| |
| -----pom.xml
|
|
-----core (Module 2)
|
-----src
| |
| -----main
| | |
| | -----java
| |
| -----test
|
|
|
-----pom.xml
Problem Overview:
- Configuration: As per the Quarkus Documentation, JaCoCo is configured to consider test classes not annotated with @QuarkusTest by executing the prepare-agent goal.
- Current Status: I have successfully obtained coverage reports for Module 1 (api) using the jacoco-maven-plugin and for Module2 (core) using quarkus-jacoco.
- Issue: However, the coverage report does not accurately reflect the tests conducted in Module 2 (core) that involve methods from Module 1 (api). This discrepancy arises due to the concurrent usage of both jacoco-maven-plugin and quarkus-jacoco.
Request for Assistance: I seek suggestions and guidance on how to rectify this issue and ensure that cross-module tests are accurately reflected in the coverage reports for both modules. Any insights, recommendations, or best practices in configuring JaCoCo within a multi-module Quarkus project would be greatly appreciated.
Screenshots for Reference: In this example isEmpty() is covered in api module but not in core module because the test is in api module .
isEmpty() in core module coverage isEmpty() in api module coverage