I tried to use sonar scanning example project: maven-multimodule, and overall it works, but if I want to add a twist to it, as module of the testing, has also classes to test on it own, it won’t work.
My project structure:
testing-modules/
├── pom.xml - root pom
├── module1/
│ └── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── org/example/module1/
│ └── MyClassModule1.java
└── module2/
│ └── pom.xml
│ └── src/
│ └── main/
│ └── java/
│ └── org/example/module2/
│ └── MyClassModule2.java
|
│ └── test/
│ └── java/
│ └── org/example/module2/
│ └── MyClassModule1Test.java
│ └── MyClassModule2Test.java
I tried different variations of the testing agents in the jacoco, but none of them gave me the results I wanted = coverage for both MyClassModule1 and MyClassModule2 classes(doesn’t matter if in a single report, or multiple reports, as eventually sonar will aggregate them by himself with the jacoco.exec files)
my current progress is having Module2 report, with coverage of Module1, but without Module2 coverage:
my project