sonar:
- Community Edition Version 10.2.1 (build 78527)
- jdk 11
- maven sonar plugin sonar-maven-plugin:3.9.1.2184:sonar
- jacoco plugin jacoco-maven-plugin:0.8.10
we have integration maven/jacoco/sonar in our multi module maven project.
after we run the commnad
mvn $SONAR_OPTS clean test verify sonar:sonar
we check the local jacoco report:
however, we check the sonar server page:
so, our question is, why the coverage in sonar server is 0.0%?
the maven project structure is
cloud-common(repo root)
|-- event-starter
|-- pom.xml
|-- cloud-common
|-- pom.xml
|-- cloud-common-jacoco
|-- pom.xml
|-- pom.xml
the pom.xml in repo root have <modules>
elements
event-starter
module depend on module cloud-common
cloud-common-jacoco
is a special module which depends on event-starter
and cloud-common
, and have a report-aggregate
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
the java class NeedRemovedService in cloud-common
and our tests are in event-starter
modules
again, after maven run, we check the report in cloud-common-jacoco
, I think it match our expect.
very thanks if any suggestions as blocked months