zoukankan      html  css  js  c++  java
  • 【原创】Maven cobertura整合多个子项目下的单测覆盖率报告

    今天在调试一个UT job的时候发现找不到cobertural报告文件,后来发现在Maven的自项目里找到了对应的代码覆盖率报告,但都是是分散在每个子项目下面的,看起来很不方便。就在想是不是可以把这些报告都汇集到一起呢?结果还真是被我在stackoverflow里找到了。下面是原帖内容,我就一并粘过来吧:

    The plugin has been updated since this question was asked (and last answered) to now enable aggregated reporting, via the aggregate configuration property in the parent POM.

    This produces the aggregated coverage report at target/site/cobertura/index.html which will include all modules.

    (Each module will also have it's own report produced, if that is of any use.)

    Parent pom.xml

    <modules>
        <module>moduleA</module>
        <module>moduleB</module>
        <module>moduleC</module>
    <modules>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <check/>
                        <formats>
                            <format>html</format>
                            <format>xml</format>
                        </formats>
                        <aggregate>true</aggregate>
                    </configuration>
                </plugin>
                ...
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
            </plugin>
        </plugins>
    ...
    </build>
  • 相关阅读:
    137. 只出现一次的数字 II
    JS_利用Canvas进行图片旋转
    JS_图片压缩并预览
    计蒜客——等和的分隔子集
    中缀表达式转后缀并计算(只考虑个位整数,不考虑除0等情况)
    求最小数 * 区间和最大值
    967 质量检测
    PAT-1102(Invert a Binary Tree)
    PAT-1100(Mars Numbers)
    PAT-1099(Build A Binary Search Tree)
  • 原文地址:https://www.cnblogs.com/testermark/p/4322018.html
Copyright © 2011-2022 走看看