Sonar安装
1. JDK1.8安装
安装jdk1.8这里省略。
2. SonarQube 部署
su - jenkins #为了在jenkins中集成sonar,所以安装在jenkins用户下 cd /data/jenkins wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.3.zip unzip sonarqube-6.3.zip ln -s /data/jenkins/sonarqube-6.3 /data/jenkins/sonarqube
3. 准备mysql数据库
安装mysql这里省略 创建数据库sonar
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar'; GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar'; FLUSH PRIVILEGES;
4. 修改sonar配置
修改sonar.properties的数据库连接
# cd /data/jenkins/sonarqube/conf # vim sonar.properties sonar.jdbc.username=sonar sonar.jdbc.password=sonar sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
5. 启动sonarqube
cd /data/jenkins/sonarqube/bin/linux-x86-64 ./sonar.sh start
6. 安装sonar插件
sonar有很多插件,安装插件只需要将插件下载到extensions/plugins目录下然后重启sonar就可以了<br/> 安装汉化插件
cd /data/jenkins/sonarqube/extensions/plugins wget https://github.com/SonarQubeCommunity/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-1.11/sonar-l10n-zh-plugin-1.11.jar
重启sonarqube
cd /data/jenkins/sonarqube/bin/linux-x86-64 ./sonar.sh restart
7. 安装 Sonar Scanner
cd /data/jenkins wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.6.0.zip unzip sonar-scanner-2.6.0.zip ln -s /data/jenkins/sonar-scanner-2.6.0/ /data/jenkins/sonar-scanner
8. 配置sonar-scanner
# vim /usr/local/sonar-scanner/conf/sonar-scanner.properties sonar.host.url=http://localhost:9000 sonar.sourceEncoding=UTF-8
相关推荐
sakurayz 2020-06-16
yuanyuan 2020-06-14
yuanyuan 2020-06-14
hevenue 2020-06-04
yieryi 2020-06-02
yuanyuan 2020-05-17
huaqiangli 2020-05-14
yangliuhbhd 2020-05-11
一片荷叶 2020-05-09
静水楼台 2020-05-09
huaqiangli 2020-04-27
yieryi 2020-04-10
郭宇 2020-02-14
xiaodaiwang 2020-02-02
xiaodaiwang 2020-01-09
leonranri 2019-12-16
xiaodaiwang 2019-11-02
chwnpp 2018-01-05
冯冯领队 2019-10-27
sakurayz 2019-10-24
arnodzl 2019-07-31
sakurayz 2019-04-05
BigBirds 2019-09-12
huaqiangli 2019-08-05
wesaylove 2017-06-19
静水楼台 2019-07-24
mydownloador 2019-07-24
BORISHOU 2019-07-23
yuanyuan 2016-11-25
sakurayz 2015-07-25
骑苍蝇过大海 2015-06-19
BigBirds 2019-06-28
sakurayz 2019-06-28