Created
April 20, 2022 09:48
-
-
Save Dibae101/9cab2b519f0a438e29807c3f5ef680ff to your computer and use it in GitHub Desktop.
SonarQube Jenkins Integration The JenkinsFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline{ | |
agent{ | |
docker { | |
image 'maven:3.5.2' | |
} | |
} | |
stages{ | |
stage('Build'){ | |
steps{ | |
sh 'mvn clean install -DskipTests' | |
} | |
} | |
stage('SonarQube analysis') { | |
// def scannerHome = tool 'SonarScanner 4.0'; | |
steps{ | |
withSonarQubeEnv('sonarserver') { | |
// If you have configured more than one global server connection, you can specify its name | |
// sh "${scannerHome}/bin/sonar-scanner" | |
sh "mvn sonar:sonar" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment