Question

Currently I'm trying to do a Integration Test + Clover +Sonar I was available to do so (I can see in sonar the total coverage,(IT + Unit testing) together ) The issue is pretty much that the source been upload to sonar are the ones clover generates to do his thing.

[INFO] [16:16:57.566] Working dir:/Users/cortiz/dev/company/tmp/profile/server/target/sonar
[INFO] [16:16:57.566] Source dirs:/Users/cortiz/dev/company/tmp/profile/server/target/clover/src-instrumented
[INFO] [16:16:57.566] Test dirs:/Users/cortiz/dev/company/tmp/profile/server/target/clover/src-test-instrumented
[INFO] [16:16:57.566] Binary dirs:/Users/cortiz/dev/company/tmp/profile/server/target/classes

Or a lot __CLR** stuff all around) so the source code is not actually readable or accurate

How I run it is using this command

mvn clean clover2:setup install clover2:clover sonar:sonar -PSonar

And the Sonar profile is

    <profile>
        <id>Sonar</id>
        <properties>
            <clover.version>3.1.8</clover.version>
            <sonar.core.codeCoveragePlugin>clover</sonar.core.codeCoveragePlugin>
            <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
            <sonar.clover.reportPath>${project.build.directory}/clover.xml</sonar.clover.reportPath>
            <sonar.sources>bork</sonar.sources>
            <sonar.exclusions>**/clover/src-instrumented/**</sonar.exclusions>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>maven-clover2-plugin</artifactId>
                    <version>${clover.version}</version>
                    <configuration>
                        <license>${clover.license}</license>
                        <reportDescriptor>clover-report.xml</reportDescriptor>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

If needed I can put more info.

Was it helpful?

Solution

Suggested by DavidRACODON

mvn clean clover2:setup install clover2:clover -PSonar 
mvn sonar:sonar -DskipTests -PSonar 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top