docker安装
docker pull postgres:10
docker pull sonarqube:7.9.1-community
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=1 --name postgres postgres:10
docker run -d -p 9000:9000 -e "SONARQUBE_JDBC_URL=jdbc:postgresql://192.168.114.131:5432/sonar" -e "SONARQUBE_JDBC_USERNAME=postgres" -e "SONARQUBE_JDBC_PASSWORD=1" --name sonarqube sonarqube:7.9.1-community
启动之前需要创建sonar数据库
token: cd8b3ea31118fa0b88cd8b0bdc6a9bd0e73984a9
/usr/local/sonar-scanner-4.4.0.2170-linux/bin/sonar-scanner
/opt/webroot/paydayloan/paydayloan-Server
使用Maven执行SonarQube分析是非常简单的。只需要在你的项目目录下执行如下命令
mvn sonar:sonar
-Dsonar.projectKey=java
-Dsonar.host.url=http://172.16.2.131:9000
-Dsonar.login=cd8b3ea31118fa0b88cd8b0bdc6a9bd0e73984a9
mvn sonar:sonar -Dsonar.projectKey=java -Dsonar.host.url=http://172.16.2.131:9000 -Dsonar.login=cd8b3ea31118fa0b88cd8b0bdc6a9bd0e73984a9
E:sonar-scanner-4.4.0.2170-windowsinsonar-scanner.bat -D"sonar.projectKey=java" -D"sonar.sources=." -D"sonar.host.url=http://172.16.2.131:9000" -D"sonar.login=cd8b3ea31118fa0b88cd8b0bdc6a9bd0e73984a9" -D"sonar.java.binaries=D:javahfq-payments-aggregatorpayments-server argetclasses"
sonar-scanner
-Dsonar.projectKey=java
-Dsonar.sources=.
-Dsonar.host.url=http://172.16.2.131:9000
-Dsonar.login=cd8b3ea31118fa0b88cd8b0bdc6a9bd0e73984a9
/usr/local/sonar-scanner-4.4.0.2170-linux/bin/sonar-scanner
-Dsonar.projectKey=python
-Dsonar.sources=.
-Dsonar.host.url=http://172.16.2.131:9000
-Dsonar.login=cd8b3ea31118fa0b88cd8b0bdc6a9bd0e73984a9