下载
SonarQube下载地址:
https://www.sonarqube.org/downloads/
SonarQube Scanner下载地址:
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
配置
打开sonar.properties,配置:
sonar.jdbc.url=jdbc:mysql://127.0.0.1:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.jdbc.username=root
sonar.jdbc.password=root
sonar.sorceEncoding=UTF-8
sonar.login=admin
sonar.password=admin
打开sonar-scanner.properties,配置:sonar.host.url=http://127.0.0.1:9000
jenkins
全局配置
系统配置
job配置
sonar.projectKey=qingzhuhotel
sonar.projectName=qingzhuhotel
sonar.projectVersion=1.0
sonar.sources=src
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.java.binaries=target/classes
启动sonar
进入bin目录,
/Users/qiaojiafei/Documents/work/soft/sonarqube-6.7.6/bin/macosx-universal-64
执行命令:
./sonar.sh start
sonar生成令牌token