代码分析、单元测试、覆盖率统计
git clone https://github.com/spring-projects/spring-petclinic
cd spring-petclinic
mvn clean package
java -jar target/*.jar
mvn \
-Dmaven.gitcommitid.skip=true \
-Dcheckstyle.skip \
-Dmaven.test.skip=true \
clean package
mvn \
-Dmaven.gitcommitid.skip=true \
-Dcheckstyle.skip \
clean test
mvn \
-Dmaven.gitcommitid.skip=true \
-Dcheckstyle.skip \
-Dmaven.test.skip=true \
clean test jacoco:report
sudo docker run -d \
-u root\
--name jenkins_shift \
-p 8020:8080 -p 50000:50 \
-v $PWD/jenkins_home:/var/jenkins_home \
jenkins/jenkins:2.401.2-lts
在线演练地址 sonarqube.hogwarts.ceshiren.com
docker run -d \
--name sonarqube_temp \
-p 9000:9000 -p 9092:9092 \
sonarqube
SQ_HOST=https://sonarqube.hogwarts.ceshiren.com/
SQ_TOKEN=sqa_e2b722379113008c81b41ce8376be6056068387d
mvn \
-Dmaven.gitcommitid.skip=true \
-Dcheckstyle.skip \
clean test jacoco:report \
org.sonarsource.scanner.maven:sonar-maven-plugin:LATEST:sonar \
-Dsonar.host.url=$SQ_HOST \
-Dsonar.login=$SQ_TOKEN \
-Dsonar.coverage.jacoco.xmlReportPaths=**/jacoco/jacoco.xml