SonarQube deployment document for code quality management platform
I. description of system software
Centos-7.6 mysql-5.7.25 jdk-1.8.0_152 apache-maven-3.6.0 sonarqube-7.5
II. Skip installation of jdk and mysql
School time, selinux, iptables, time zone, swap, openfile_limit, jdk, mysql find documents to deal with themselves
Create a sonar library and authorize it to sonar users
Third, install sonarqube
Modify the configuration file sonar.properties
Sonar.jdbc.url=jdbc:mysql://192.168.8.88:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=falsesonar.jdbc.username=sonar # mysql username sonar.jdbc.password=sonar # mysql password sonar.web.javaOpts=-Xmx512m-Xms128m-XX:+HeapDumpOnOutOfMemoryErrorsonar.web.context=/sonarsonar.web.port=9000sonar.log.level=INFOsonar.log.level.es=INFO
Startup program
> useradd sonar > chown-R sonar.sonar / usr/local/sonarqube > su-soanr > / usr/local/sonarqube/elasticsearch/bin/elasticsearch-d > / usr/local/sonarqube/bin/linux-x86-64/sonar.sh start
Check
Tail-200f / usr/local/sonarqube/logs/es.logtail-200f / usr/local/sonarqube/logs/sonar.lognetstat-lnpt | egrep "9000 | 9001 | 9200 | 9300 | 3306"
4. Integrate into maven
Add the following to the maven profile setting.xml
Org.sonarsource.scanner.mavensonartrue http://192.168.8.88:9000/sonar
Add the following to the project pom.xml
Org.sonarsource.scanner.mavensonar-maven-plugin3.6.0.1398
Pass in the sonar:sonar parameter at compile time
Mvn clean package sonar:sonar