由于无法解决的依赖关系而产生声纳警告 [英] Sonar warnings due to unresolvable dependencies
问题描述
我们的项目是一个使用maven构建的多模块插件项目.声纳分析运行良好,但在此过程中会生成许多警告,并可能产生不正确的结果.以下是项目的设置以及分析期间生成的警告.我们非常感谢您为解决这些警告提供任何帮助.
Our project is a multi module plugin project built using maven. The Sonar analysis runs fine but in the process generates a lot of warnings and probably incorrect results. Below is the set up of the project and warnings generated during analysis. Any help in fixing these warnings is highly appreciated.
项目设置:
- 通过jenkins构建进行声纳分析.
- Jenkins Sonar插件用于运行分析.
- Jenkins和Sonar以及MySQL在不同的计算机上运行.
在声纳分析过程中,将以下属性提供给Jenkins中的Sonar插件.
Below properties are provided to Sonar plugin in Jenkins during sonar analysis.
-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
以下是在分析过程中生成的警告:
Below are the warnings generated during analysis:
注意:如果Sonar和Jenkins在同一台计算机上运行,则不会生成以下警告
- 在对各个模块进行声纳分析之前,会引发以下错误.
[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
推荐答案
我知道这是一个较晚的答复,但是我遇到了同样的问题,结果发现我运行的是mvn clean package
而不是mvn clean install
.我发现此线程(位于SonarQube邮件列表上),希望对您有所帮助.
I know this is a late reply, but I had the same problem and it turned out that I had run mvn clean package
instead of mvn clean install
. I found this thread on the SonarQube mailing list, hope this helps.
这篇关于由于无法解决的依赖关系而产生声纳警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!