Skip to content

Instantly share code, notes, and snippets.

@Dibae101
Created April 20, 2022 09:48
Show Gist options
  • Save Dibae101/9cab2b519f0a438e29807c3f5ef680ff to your computer and use it in GitHub Desktop.
Save Dibae101/9cab2b519f0a438e29807c3f5ef680ff to your computer and use it in GitHub Desktop.
SonarQube Jenkins Integration The JenkinsFile
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