Sonar + Clover仅在src-instrumented上运行

时间:2013-08-06 22:32:06

标签: java maven sonarqube clover

目前我正在尝试进行集成测试+ Clover + Sonar我可以这样做(我可以在声纳中看到总覆盖率,(IT +单元测试)) 问题几乎就是上传到声纳的来源是三叶草产生的事情。

[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

或者很多__CLR **所有的东西)所以源代码实际上不可读或准确

我如何运行它是使用此命令

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

声纳配置文件是

    <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>

如果需要,我可以提供更多信息。

1 个答案:

答案 0 :(得分:1)

DavidRACODON建议

mvn clean clover2:setup install clover2:clover -PSonar 
mvn sonar:sonar -DskipTests -PSonar 
相关问题