1、下载SonarQube Scanner安装包
在下载地址中挑选合适的安装包:https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/,本文中使用的是sonar-scanner-2.8.zip
2、、安装及配置SonarQube Scanner
1)将下载的安装包解压到指定目录/export/data/tomcatRoot/scanner.jd.com($SCANNER_HOME)
2)修改$SCANNER_HOME\conf\sonar-scanner.properties,如下,将红字替换成实际地址:
#Configure here general information about the environment, such as SonarQube DB details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
注:如需修改JDK配置,修改$SCANNER_HOME\bin\sonar-runner文件,如下添加红字部分并将路径替换成实际路径
#!/bin/sh
#