持续代码质量管理-SonarQube Scanner部署 2.1. 软件安装2.2. 配置修改

2020-10-15 14:31:15 浏览数 (2)

1. SonarQube Scanner地址

上一篇文章我们安装了SonarQube-7.3,让我们可以在页面查看代码质量。但是具体的扫描工作则需要SonarQube Scanner完成。

下载页面

代码语言:javascript复制
1 https://docs.sonarqube.org/display/SCAN/Analyzing with SonarQube Scanner    

2. 安装SonarQube Scanner

2.1. 软件安装

代码语言:javascript复制
 1 [yun@mini04 software]$ pwd
 2 /app/software
 3 [yun@mini04 software]$ wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip
 4 [yun@mini04 software]$ unzip sonar-scanner-cli-3.2.0.1227-linux.zip
 5 [yun@mini04 software]$ mv sonar-scanner-3.2.0.1227-linux /app/
 6 [yun@mini04 software]$ cd /app/
 7 [yun@mini04 ~]$ ln -s sonar-scanner-3.2.0.1227-linux/ sonar-scanner
 8 [yun@mini04 ~]$ ll -d sonar-scanner*
 9 lrwxrwxrwx 1 yun yun 31 Oct 14 15:47 sonar-scanner -> sonar-scanner-3.2.0.1227-linux/
10 drwxr-xr-x 6 yun yun 51 May 23 09:21 sonar-scanner-3.2.0.1227-linux

2.2. 配置修改

代码语言:javascript复制
 1 [yun@mini04 conf]$ pwd
 2 /app/sonar-scanner/conf
 3 [yun@mini04 conf]$ vim sonar-scanner.properties
 4 #----- Default SonarQube server
 5 sonar.host.url=http://mini04:9000
 6 
 7 #----- Default source code encoding
 8 sonar.sourceEncoding=UTF-8
 9 
10 sonar.jdbc.username=sonar
11 sonar.jdbc.password=sonar
12 sonar.jdbc.url=jdbc:mysql://mini05:3306/sonar?useUnicode=true&characterEncoding=utf8

0 人点赞