gpt4 book ai didi

java - 使用 Sonar 扫描仪扫描项目时出错

转载 作者:行者123 更新时间:2023-12-01 17:50:59 25 4
gpt4 key购买 nike

我一直在尝试使用 Sonar 扫描仪扫描 java 项目 (ArgoUML),但在项目目录中使用 sonar-scanner 时出现以下错误:

ERROR: Error during SonarQube Scanner execution
ERROR: Please provide compiled classes of your project with sonar.java.binaries property

该项目是从此存储库克隆的: https://github.com/cscorley/argouml-mirror

我尝试使用 mvn packagemvn install 使用 maven 进行构建,但每次都会出现错误。我得到的最后一个错误是:

Results :

Failed tests:

Tests in error:

Tests run: 1106, Failures: 2, Errors: 8, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] argouml-core 0.35.2-SNAPSHOT ....................... SUCCESS [ 0.898 s]
[INFO] argouml-core-model ................................. SUCCESS [ 0.783 s]
[INFO] argouml-core-model-mdr ............................. SUCCESS [ 8.167 s]
[INFO] argouml-core-model-euml ............................ SUCCESS [ 0.162 s]
[INFO] argouml-app ........................................ FAILURE [04:55 min]
[INFO] argouml-core-notation .............................. SKIPPED
[INFO] argouml-core-transformer ........................... SKIPPED
[INFO] argouml-core-umlpropertypanels ..................... SKIPPED
[INFO] argouml-core-diagrams-activity2 .................... SKIPPED
[INFO] argouml-core-diagrams-class2 ....................... SKIPPED
[INFO] argouml-core-diagrams-sequence2 .................... SKIPPED
[INFO] argouml-core-diagrams-state2 ....................... SKIPPED
[INFO] argouml-core-diagrams-structure2 0.35.2-SNAPSHOT ... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:05 min
[INFO] Finished at: 2018-05-03T12:07:31+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.8.1:test (default-test) on project argouml: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/redhood148/Documents/git/argouml-mirror/src/argouml-app/target/surefire-reports for the individual test results.

有什么建议可以解决这个问题吗?如果您需要更多信息,请告诉我。

谢谢。

最佳答案

我不太清楚其原因,但可以帮助您找到适合我的解决方案。

您必须在配置中的“sonar.sources”下提及源路径,指定需要扫描代码的源包。例如。 sonar.sources=/home/workspace/codecoveragejob/Test_project/Test_project_service/src

与此属性一起,在“sonar.java.binaries”下设置另一个属性,并提供与“sonar.sources”相同的值。

所以它看起来像这样:

sonar.sources=/home/workspace/codecoveragejob/Test_project/Test_project_service/src

sonar.java.binaries= /home/workspace/codecoveragejob/Test_project/Test_project_service/src

希望有帮助...

关于java - 使用 Sonar 扫描仪扫描项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50153157/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com