MVN全新安装后,Cobertura不生成覆盖率报告

时间:2019-07-28 10:02:56

标签: java maven code-coverage cobertura maven-cobertura-plugin

在我的基于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>


0 个答案:

没有答案
相关问题