pipeline {
agent any
options {
ansiColor('xterm')
}
stages {
stage('Build') {
steps {
sh 'mvn -DskipTests clean package'
stage('Test') {
sh 'mvn test'
post {
always {
junit '*/target/surefire-reports/*.xml'
publishCoverage adapters: [jacocoAdapter(mergeToOneReport: true, path: '*/target/site/jacoco/jacoco.xml')]
stage('SonarQube Analysis') {
when {
branch 'develop'
withSonarQubeEnv('KSKE SonarQube') {
sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar'
success {
archiveArtifacts artifacts: '*/target/undo-redo-*.jar'