Commit d27c18ec authored by Fernando Vazquez's avatar Fernando Vazquez

Added sonar package

parent 2293aa99
...@@ -23,11 +23,12 @@ pipeline { ...@@ -23,11 +23,12 @@ pipeline {
stage('Build') { stage('Build') {
steps { steps {
echo "Building project..." echo "Building project..."
sh 'mvn -Dmaven.test.failure.ignore=false install' sh 'mvn clean install'
} }
} }
stage('Test'){ stage('Test'){
steps{ steps{
echo "Running tests..."
sh 'mvn test' sh 'mvn test'
} }
post { post {
...@@ -39,7 +40,9 @@ pipeline { ...@@ -39,7 +40,9 @@ pipeline {
stage('SonarQube Analysis') { stage('SonarQube Analysis') {
steps{ steps{
withSonarQubeEnv('Sonarqube') { withSonarQubeEnv('Sonarqube') {
echo "Running SonarQube analysis...."
sh "mvn clean verify sonar:sonar -Dsonar.projectKey=hello-spring" sh "mvn clean verify sonar:sonar -Dsonar.projectKey=hello-spring"
sh "mvn package sonar:sonar"
} }
} }
} }
...@@ -50,7 +53,7 @@ pipeline { ...@@ -50,7 +53,7 @@ pipeline {
} }
} }
} }
stage("publish to nexus") { stage("Publish to Nexus") {
steps { steps {
script { script {
// Read POM xml file using 'readMavenPom' step , this step 'readMavenPom' is included in: https://plugins.jenkins.io/pipeline-utility-steps // Read POM xml file using 'readMavenPom' step , this step 'readMavenPom' is included in: https://plugins.jenkins.io/pipeline-utility-steps
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment