【问题标题】:SonarQube dependency check sonar pluginSonarQube 依赖检查声纳插件
【发布时间】:2016-08-11 22:22:15
【问题描述】:

我在 SonarQube 上显示漏洞时遇到问题。以下是我遵循的步骤:

  1. 在 SonarQube 上安装了 dependency-check-sonar-plugin 1.0.3 版。

  2. 配置仪表板以包含漏洞widjet。

  3. 使用 mvn org.owasp:dependency-check-maven:1.3.6:check -Dformat=XML 生成依赖关系报告。

  4. 报告已放入 [project]/target/dependency-check-report.xml

  5. 运行声纳任务:org.codehaus.mojo:sonar-maven-plugin:2.3:sonar 任务已成功完成,但我在 Vulnerabilities widjet 中看不到数据。 任何人都知道什么会阻止插件查看报告?

提前致谢! 拉达

【问题讨论】:

  • 到目前为止你做了什么来解决这个问题? (也:SonarQube 版本?依赖检查的日志?分析和调用命令的日志?)
  • 问题已解决。非常感谢插件的创建者,他为我指明了正确的方向!
  • 你应该与社区的其他人分享解决方案:)(在 StackOverflow 中你可以回答你自己的问题)

标签: java maven dependencies sonarqube


【解决方案1】:

为了解决这个问题,我联系了插件的创建者 Steve Springett。他对如何配置插件有很好的端到端examples
我在 pom 的属性中添加了<sonar.dependencyCheck.reportPath>${dependency.check.report.dir}/dependency-check-report.xml</sonar.dependencyCheck.reportPath>,并使用了以下两个插件:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sonar-maven-plugin</artifactId>
    <version>2.6</version>
</plugin>
<plugin>
    <groupId>org.owasp</groupId>
    <artifactId>dependency-check-maven</artifactId>
    <version>1.3.1</version>
    <configuration>
        <format>XML</format>
        <outputDirectory>${dependency.check.report.dir}</outputDirectory>
    </configuration>
</plugin>

【讨论】:

  • 如果maven插件上传到xml到sonarqube就好了。并非所有设置都在同一主机上。
  • XML 格式已弃用,sonar.dependencyCheck.reportPath 已替换为 sonar.dependencyCheck.jsonReportPath 和 sonar.dependencyCheck.htmlReportPath
猜你喜欢
  • 2016-08-21
  • 2017-07-19
  • 1970-01-01
  • 2016-11-09
  • 2014-09-07
  • 2015-10-18
  • 2020-01-10
  • 2016-01-22
  • 2015-12-08
相关资源
最近更新 更多