🗒️sonar qube使用打包
2021-7-2
| 2023-8-10
0  |  0 分钟
type
status
date
slug
summary
tags
category
icon
password
清单:
postgresql数据库(插件使用)
sonarqube-9.9
sonar-scanner本地扫描器
plugins插件{
xml分析插件 mybatis xml分析插件 中文插件 pdf报告插件 web页面分析插件 js分析插件 dependency-check owasp依赖性检查
}
soanrlint idea集成插件
 
soanr qube下载
sonarqube配置数据库
数据库postgresql 12
安装完成后,使用安装的pgadmin4工具进行创建数据库.
pgadmin4设置中文:file-Preferences-Miscellaneous-user language-chinese-save
notion image
notion image
notion image
创建数据库给sonar用户
notion image
 
notion image
断开数据库连接,切换为sonar账号
notion image
 
notion image
notion image
数据库配置
conf-sonar-properties
 
汉化插件
pdf报告插件
 
sonar-scanner下载
 
2.conf下的sonar-scanner.properties文件配置服务地址
notion image
3.配置环境变量,sonar-scanner -h测试
notion image
notion image

配置您的项目

在项目的根目录中创建一个名为sonar-project.properties
解释
sonar-scanner扫描配置文件示例
问题
扫描必须有编译文件,否则会报错
使用pdf插件会报错,但是不影响
 
sonar 集成dependency依赖性检查插件
 
生成报告
2.1sonar-scanner + OWASP Dependency-Check
(1)下载dependency-check-7.0.0-release.zip,加压后放到项目所在服务器,进入dependency-check/bin/,执行命令。
下载地址:https://owasp.org/www-project-dependency-check/
Linux:bashdependency-check.sh --project 项目名称 -s lib库的路径-o 报告保存路径
Windows:dependency-check.bat--project 项目名称 -s lib库的路径(项目路径)-o 报告保存路径
eg.  dependency-check.bat --project RISK3.0 –s  C:\lxf\risk3.0\code\risk-framework -o C:\lxf\risk3.0\code\risk-framework
(2)sonar-project.properties添加配置项:
sonar.dependencyCheck.htmlReportPath=./dependency-check-report.html
sonar.dependencyCheck.summarize=true
sonar.dependencyCheck.securityHotspot=true
(3)执行sonar-scanner,查看报告,在sonarQube页面,选择刚刚扫描的项目,选择更多,点击Dependency-Check,即可查看报告(构建完成后,在sonarQube页面,选择刚刚扫描的项目,选择更多,点击Dependency-Check,即可查看报告(建议使用Chrome 或Edge,IE无法查看)):
作者:fengorange
链接:https://www.jianshu.com/p/a0ba4011d9eb
 
sonar link
安装插件
服务连接
notion image
notion image
 
maven默认仓库更改Could not transfer artifact
目录