- Install
SonarQube Scanner
plugin in Jenkins. - Global Configuration.
Log into Jenkins as an administrator and go toManage Jenkins > Global Tool Configuration
: Create Pipeline job.
Add the below Pipeline script:1
2
3
4
5
6
7
8
9
10
11
12node {
def mvnHome
stage('SCM and configration') {
git 'https://github.com/yongfeiuall/spring-boot-example.git'
mvnHome = tool 'M3'
}
stage('SonarQube analysis') {
withSonarQubeEnv('SonarQube') {
sh "'${mvnHome}/bin/mvn' clean package sonar:sonar"
} // SonarQube taskId is automatically attached to the pipeline context
}
}Run job.
SonarQube with Jenkins pipeline
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!
- Post link: http://izheyi.com/2018/10/14/SonarQube-with-Jenkins-pipeline/
- Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.