我尝试实现sonar + failsafe + jacoco插件。我将theese添加到了pom.xml文件中
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-plugin-api</artifactId>
<version>7.5</version>
<scope>provided</scope>
</dependency>
并且我将此插件添加到了同一文件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<argLine>--add-modules java.base</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<propertyName>jacoco.agent.argLine</propertyName> <!-- default: argLine -->
<includes>
<include>**/*IT.java</include>
</includes>
<destFile>${project.build.directory}/jacoco-it.exec</destFile> <!-- agent -->
<dataFile>${project.build.directory}/jacoco-it.exec</dataFile> <!-- report -->
</configuration>
<executions>
<execution>
<id>agent</id>
<goals><goal>prepare-agent</goal></goals>
</execution>
</executions>
</plugin>
并且它已经存在于我的pom.xml中
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>${it.skip}</skip>
<argLine>--add-modules java.base</argLine>
<forkCount>4</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>*IT</include>
</includes>
<systemPropertyVariables>
<doc.skip>${doc.skip}</doc.skip>
</systemPropertyVariables>
</configuration>
</plugin>
然后运行 mvn clean verify -P集成测试,然后运行 mvn sonar:sonar 但我仍然得到的覆盖率是0.0%为什么没有得到IT的报告结果?请帮助我。.我怎么了?