我想在我的项目中进行测试覆盖。我创建了个人资料:我的 pom xml 个人资料是:
<profile>
<id>test-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration combine.self="override">
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<testFailureIgnore>true</testFailureIgnore>
<argLine>
-Xms128m -Xmx1G -XX:MaxPermSize=128M
</argLine>
<groups>com.project.test.annotation.QuickTest</groups>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
我正在运行这些命令: mvn clean install -DfailIfNoTests=false -P test-coverage mvn sonar:sonar
我无法获得测试覆盖率,我错过了什么?我的声纳版本:4.3