I have a maven project in the following structure:
1 class under the project and 1 model with a class.
In both of them there are test classes:
-testProject
-src
-main
-java
Class2.java
-test
-java
Test2.java
-Infra Module
-src
-main
-java
Class1.java
-test
-java
Test1.java
in the main pom I configure jacoco plugin:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>prepare-agent</id>
<phase>initialize</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<includes>
<include>*</include>
</includes>
</configuration>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
and also I configure in properties the xmlReportsPath:
<sonar.coverage.jacoco.xmlReportPaths>{project.basedir}/target/site/jacoco-aggregate/jacoco.xml, {project.basedir}/infra/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
I run:
mvn clean verify sonar:sonar
I get 0% coverage and error that scoverage.xml file is not found.
The jacoco.xml files are not containing information on tests that were run.
Also, the warning below which I think is not correlated to the problem:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/C:/Users/navap/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byt
e,int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
What is wrong?
Thank you,
Nava Polak Onik.