本文介绍了Sonar + Clover仅在src乐器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前,我正在尝试进行集成测试+三叶草+声纳(我可以在声纳中看到总覆盖率,(IT +单元测试))问题在于,三叶草产生的声源已经上传到声纳.
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
或者周围有很多__CLR **的东西),因此源代码实际上不是可读或准确的
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
Sonar的个人资料是
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.
推荐答案
DavidRACODON建议
Suggested by DavidRACODON
mvn clean clover2:setup install clover2:clover -PSonar
mvn sonar:sonar -DskipTests -PSonar
这篇关于Sonar + Clover仅在src乐器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!