pipeline { agent any stages { stage ('Build') { steps { sh 'mvn -B -DSkipTests -Dspring.profiles.active=prod clean package' } } stage ('Test') { steps { sh 'mvn test -Dspring.profiles.active=prod' } } stage ('Capture') { steps { archiveArtifacts 'target/*.jar' junit 'target/surefire-reports/*.xml' } post { always { cleanWs() } success { echo 'Build Success...' } } } } }