sonar 简单安装,配置,以及使用
服务端启动配置 1.下载sonarqube-5.1.zip server包 http://downloads.sonarsource.com/sonarqube/sonarqube-5.1.zip 2.安装mysql 服务端 并创建sonar用户,sonar数据库 #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 3.修改sonarconfig文件 /Users/dengkui/soft_install/sonarqube-5.1/conf/sonar.properties sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance sonar.jdbc.driverClassName=com.mysql.jdbc.Driver sonar.jdbc.username=sonar sonar.jdbc.password=sonar 4. sonar web port 修改,以防端口冲突 sonar.web.port=9999 5.启动sonar服务器 cd /Users/dengkui/soft_install/sonarqube-5.1/bin/macosx-universal-64 ./sonar.sh start 6.验证sonar是否正常启动 http://localhost:9999 查看页面是否能正常打开 客户端链接配置 1. 打开Eclipse MarkPlace,输入sonar,并安装 2. 配置SonarQube 插件,打开Perference,找到SonarQube--servers 新建server地址 ID:localhost Server Url:http://localhost:9999 username:admin password:admin 点击test connection,按照eclipse提示操作,直到提示successfully connected 3.新建maven项目,选中项目右键--Configure--Associate with SonarQube 4. 修改 settings.xml <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance</sonar.jdbc.url> <sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver> <sonar.jdbc.username>sonar</sonar.jdbc.username> <sonar.jdbc.password>sonar</sonar.jdbc.password> <sonar.host.url>http://localhost:9999</sonar.host.url> </properties> </profile> 5. 选中新建项目右键--Run as --Run Configrations,Goals项填写:sonar:sonar -X 如果发布成功,那么现在你可以去http://localhost:9999,这里查看你刚发布的项目,想做分析还是干吗都可以在这里处理了
相关推荐
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