You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SonarQube Dependency-check插件无法生成报告,请求排查指导

SonarQube Dependency-check插件扫描失败问题排查与解决

核心问题分析

提示“No HTML-Report found”本质是Sonar扫描时无法读取到你配置路径下的Dependency-check HTML报告文件,可能的原因及解决方法如下:

  • 确认报告文件是否已生成
    必须先手动运行Dependency-check工具生成指定的html和json报告,再执行SonarQube扫描。跳过这一步直接扫,Sonar找不到报告文件必然报错。运行Dependency-check的基础命令示例:

    dependency-check.sh --scan /path/to/your/project --format HTML --format JSON --out /home/ubuntu/dependency-check-report/
    

    执行后去/home/ubuntu/dependency-check-report/目录下确认是否存在dependency-check-report.html和dependency-check-report.json文件。

  • 检查路径权限与访问性
    Linux系统下,执行Sonar扫描的用户(比如sonarqube服务用户或你执行扫描的ubuntu用户)需要对/home/ubuntu/dependency-check-report/目录及其中的文件有读取权限。可以用以下命令验证:

    # 检查文件权限
    ls -l /home/ubuntu/dependency-check-report/
    # 尝试读取文件内容
    cat /home/ubuntu/dependency-check-report/dependency-check-report.html
    

    如果权限不足,执行以下命令调整:

    chmod -R 755 /home/ubuntu/dependency-check-report/
    
  • 验证路径配置的准确性
    Linux路径区分大小写,检查sonar-project.properties中的路径是否和实际文件路径完全一致,包括文件名的大小写、拼写(比如有没有把html写成htm,或者文件名多打了字符)。确保配置内容准确:

    sonar.dependencyCheck.htmlReportPath=/home/ubuntu/dependency-check-report/dependency-check-report.html
    sonar.dependencyCheck.jsonReportPath=/home/ubuntu/dependency-check-report/dependency-check-report.json
    sonar.dependencyCheck.summarize=true
    
  • 检查插件与SonarQube版本兼容性
    确认你安装的Dependency-check插件版本和SonarQube版本是否匹配。部分新版本插件要求SonarQube 9.x及以上,若你的Sonar版本过低,可能出现报告读取异常。可以在SonarQube的Marketplace中查看插件的版本兼容说明。

内容的提问来源于stack exchange,提问作者Santhosh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 07:42:12