Not getting the coverage on new code in sonar dashboard

感情迁移 提交于 2019-11-30 23:38:40

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!