在我的基于Spring的多模块Maven项目中,我想在运行mvn clean install
后生成cobertura代码覆盖率报告。以下是我正在使用的pom.xml的cobertura maven插件的一部分
<skipCobertura>false</skipCobertura>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${mavencobertura.version}</version>
<configuration>
<skip>${skipCobertura}</skip>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<aggregate>true</aggregate>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
mvn cobertura:cobertura
正在生成报告,但我希望在mvn clean install
之后生成。
我还在报告部分的下面添加了
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<reportSets>
<reportSet>
<reports>
<report>cobertura</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</reporting>