Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
saad946 authored Oct 7, 2023
1 parent ef70dff commit e389e17
Showing 1 changed file with 9 additions and 31 deletions.
40 changes: 9 additions & 31 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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'"
}
}
}

0 comments on commit e389e17

Please sign in to comment.