我们的项目是使用maven构建的多模块插件项目。 Sonar分析运行正常,但是在这个过程中会产生很多警告并可能导致错误的结果。以下是分析过程中产生的项目和警告的设置。任何帮助解决这些警告是高度赞赏。由于无法解决的依赖性造成的声呐警告
项目设置:
- 通过詹金斯构建声纳分析。
- Jenkins Sonar插件用于运行分析。
- Jenkins和Sonar以及MySQL在不同的机器上运行。
在声纳分析过程中,Jenkins中的Sonar插件提供了以下属性。
-Dsonar.profile="My Project Profile" -Dsonar.dynamicAnalysis=reuseReports -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.jacoco.reportPath=../../releng/com.mycompany.myproject.releng.builds/coverage_data/jacoco.exec
下面是分析过程中产生的警告:
注:以下警告没有产生,如果声纳与詹金斯在同一台机器
- 正在运行的声纳分析之前个别模块引发以下错误。
[WARNING] The following dependencies could not be resolved at this point of the build but seem to be part of the reactor: 15:04:52 [WARNING] o com.mycompany.myproject.plugins:com.mycompany.myproject.external.libraries:jar:1.0.0-SNAPSHOT (provided) 15:04:52 [WARNING] Try running the build up to the lifecycle phase "package" 15:04:52 [WARNING] The following dependencies could not be resolved at this point of the build but seem to be part of the reactor: 15:04:52 [WARNING] o com.mycompany.myproject.plugins:com.mycompany.myproject.somefunctionality.framework:jar:1.0.0-SNAPSHOT (provided)
- 在模块的分析,它抛出以下警告
Class 'com/mycompany/myproject/core/common/datatransfers/MyClass' is not accessible through the ClassLoader. [WARN] [15:05:25.731] Class 'com/mycompany/myproject/core/common/datatransfers/MyClass' is not accessible through the ClassLoader.
- 几乎与分析后跳过构建完成后,所有的模块都标,但分析结果可在Sonar中找到。
[INFO] com.mycompany.myproject.platform.feature ................ SKIPPED [INFO] com.mycompany.myproject.somefeature.feature ... SKIPPED [INFO] My Product ............................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS
我们遇到了同样的问题。我想比较环境。您是否使用JFrog Artifactory或Sonatype Nexus等本地Maven工件服务器? – buzz3791 2013-07-01 19:38:14
嗨,我也有同样的问题。你解决了这个错误吗?如果是这样,请告诉我如何解决它? – mrQWERTY 2014-07-23 14:12:32