diff --git a/Jenkinsfile b/Jenkinsfile index 7ad5696..5f3343e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,8 +32,16 @@ pipeline { } stage('SonarQube Scan') { steps { - withSonarQubeEnv('SonarQube') { - sh "sonar-scanner -Dsonar.projectKey=nvhi-atsila-microservice -Dsonar.sources=." + script { + // Resolve the SonarQube Scanner installation + def scannerHome = tool 'SonarQubeScanner' + withSonarQubeEnv('SonarQube') { + sh """ + ${scannerHome}/bin/sonar-scanner \ + -Dsonar.projectKey=nvhi-atsila-microservice \ + -Dsonar.sources=. + """ + } } } } @@ -110,4 +118,4 @@ pipeline { } } } -} +} \ No newline at end of file