未覆盖声纳仪表板中的新代码 [英] Not getting the coverage on new code in sonar dashboard

查看:15
本文介绍了未覆盖声纳仪表板中的新代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 scm 活动插件 1.8 用于 clearcase 和使用 sonar 4.3.3 并在 sonar 中得到了责备信息但没有在仪表板中获取新代码的覆盖率

I am trying to use scm activity plugin 1.8 for clearcase and using sonar 4.3.3 and got the blame information in the sonar but did not getting the coverage on new code in dashboard

推荐答案

您应该在构建过程中添加代码覆盖工具.如果你使用 Maven,那么你可以添加:

You should add Code Coverage Tool to your build process. If you use Maven, then you can add:

<build>
    ...
    <plugins>
        ...
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.5.201505241946</version>
            <executions>
                <execution>
                    <id>jacoco-initialize</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <rules>
                    <rule>
                        <element>CLASS</element>
                        <excludes>
                            <exclude>*Test</exclude>
                        </excludes>
                    </rule>
                </rules>
            </configuration>
        </plugin>
    </plugins>
    ...
</build>

这篇关于未覆盖声纳仪表板中的新代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆