在我基于 spring 的多模块 maven 项目中,我想在运行后生成 cobertura 代码覆盖率报告mvn clean install
。下面是我正在使用的 pom.xml 的 cobertura maven-plugin 的一部分
<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>