《LINUX入門:Ubuntu 14.04安裝配置SonarQube 6.0》要點(diǎn):
本文介紹了LINUX入門:Ubuntu 14.04安裝配置SonarQube 6.0,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
mysql-server-5.6(也支持其他數(shù)據(jù)庫,不過我選用的mysql)
sonarqube6.0
jdk1.8
sonar-runner-2.4
mysql -u root -p
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'sonar' IDENTIFIED BY 'sonar';
mysql> GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
mysql> GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
mysql> FLUSH PRIVILEGES;
注:在配置數(shù)據(jù)庫之前必定要確保上述軟件版本正確,否則會(huì)運(yùn)行出錯(cuò).一旦運(yùn)行出錯(cuò),需要?jiǎng)h除sonar數(shù)據(jù)庫,重新運(yùn)行上述配置語句.
export SONAR_HOME="/home/xx/file/sonarqube-6.0"
export SONAR_RUNNER_HOME="/home/xx/file/sonar-runner-2.4"
然后將SONAR_RUNNER_HOME/bin添加到path中去
vi $SONAR_HOEME/conf/sonar.properties
sonar.jdbc.username:sonar
sonar.jdbc.password:sonar
sonar.jdbc.url:jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
sonar.jdbc.driverClassName:com.mysql.jdbc.Driver
vi $SONAR_RUNNER_HOME/conf/sonar-runner.properties
sonar.host.url=[http://localhost:9000](http://localhost:9000/sonar)
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
注:以上配置文件中原來就存在的,只需要去掉相應(yīng)的注釋符號(hào)即可.
以上運(yùn)行情況都準(zhǔn)備好了之后,即可開始運(yùn)行.
在$SONAR_HOME/bin/linux-x86-64/目錄下運(yùn)行sonar.sh
sonar.sh start
可以通過查看$SONAR_HOME/log/sonar.log查看是否勝利運(yùn)行,如果看到如下日志
即成功運(yùn)行.可以在瀏覽器中訪問http://localhost:9000,如果能正常打開,說明配置正確.
注:這里我碰到一個(gè)問題,就是訪問http://localhost:9000一直訪問不了,后來改為訪問http://localhost:9000/sonar,就能正常訪問了.賬戶暗碼默認(rèn)的為admin,admin.
在待檢測(cè)工程目錄下,直接運(yùn)行sonar-runner,即開始檢測(cè).如果這里顯示無法連接http://localhost:9000/,可以檢查之前配置是否有誤.如果出現(xiàn)下面日志,闡明解析成功
19:01:51.759 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
19:01:51.759 INFO - More about the report processing at http://localhost:9000/sonar/api/ce/task?id=AVb6Au95YHi3B3QHd6Kc
19:01:51.800 INFO - Task total time: 5.674 s
根據(jù)日志中鏈接可直接查看檢測(cè)成果.
配置Sonar、Jenkins進(jìn)行連續(xù)審查
sonarQube代碼質(zhì)量管理對(duì)象環(huán)境籌建筆記
SonarQube代碼質(zhì)量治理平臺(tái)安裝與使用?
SonarQube升級(jí)進(jìn)程記錄?
Ubuntu 16.04下安裝設(shè)置裝備擺設(shè)SonarQube+MySQL?
在Fedora 21上搭建Jenkins+SonarQube的Maven項(xiàng)目自動(dòng)化測(cè)試平臺(tái)?
Sonar 的詳細(xì)先容:請(qǐng)點(diǎn)這里
Sonar 的下載地址:請(qǐng)點(diǎn)這里
本文永遠(yuǎn)更新鏈接地址:
歡迎參與《LINUX入門:Ubuntu 14.04安裝配置SonarQube 6.0》討論,分享您的想法,維易PHP學(xué)院為您提供專業(yè)教程。
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/12102.html