Not getting coverage for new code in the sonar panel

I am trying to use scm activity 1.8 plugin to clean and using sonar 4.3.3 and got fault information in sonar but not getting coverage on new code in control panel

+3


source to share


1 answer


You must add the Cover Coverage Tool to your build process. If you are using Maven 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>

      

+1


source







All Articles