diff --git a/Jenkinsfile b/Jenkinsfile index 48b4ff3..e77b900 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,9 +23,13 @@ pipeline { agent { docker { image 'amazoncorretto:22-alpine' } } - def scannerHome = tool 'SonarScanner' - withSonarQubeEnv() { - sh "${scannerHome}/bin/sonar-scanner" + steps { + script { + def scannerHome = tool 'SonarScanner' + withSonarQubeEnv() { + sh "${scannerHome}/bin/sonar-scanner" + } + } } } }