From bc5161a6c2f4507de10e35e5089d6fb433cc5d6c Mon Sep 17 00:00:00 2001 From: n Date: Fri, 10 Mar 2023 15:24:46 +0530 Subject: [PATCH] Added the new file sonar --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ea9a3751a..77ec5654c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,9 +18,15 @@ pipeline { sh 'export PATH="/usr/lib/jvm/java-1.17.0-openjdk-amd64/bin:$PATH" && mvn package' } } + stage('sonar analysis') { + steps { + withSonarQubeEnv('SONAR_TOKEN') { + sh 'mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=qtsonarqube_qtsonarqube-token -Dsonar.organization=qtsonarqube' + } + } stage('postbuild') { steps { - archiveArtifacts artifacts: '**/target/spring-petclinic.war', + archiveArtifacts artifacts: '**/target/spring-petclinic-3.0.0-SNAPSHOT.jar', followSymlinks: false junit '**/surefire-reports/TEST-*.xml' }