diff --git a/Jenkinsfile b/Jenkinsfile index b042302..fa1648d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,33 +1,11 @@ -pipeline{ - - agent any - - stages{ - - stage('sonar quality check'){ - - agent{ - - docker { - image 'maven' - } - } - steps{ - - script{ - - withSonarQubeEnv(credentialsId: 'sonar-token') { - - sh 'pwd' - sh 'ls -la' // List files in the current directory for debugging - sh 'echo $MAVEN_HOME' // Print Maven home for debugging - - sh 'mvn clean package sonar:sonar -X' - - sh 'mvn clean package sonar:sonar -e' - } - } - } - } +node { + stage('SCM') { + checkout scm + } + stage('SonarQube Analysis') { + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=devops-integration -Dsonar.projectName='devops-integration'" } + } }