Newer
Older
microservice / Jenkinsfile
pipeline {

    agent any

    tools {
        maven   'MAVEN-3.0'
        jdk     'JDK8'
    }

    stages {

        stage ('Preparation') {
            steps {
                checkout scm
            }
        }

        stage ('Build') {
            steps {
                withEnv(['MAVEN_OPTS=-Xmx512m']) {
                    sh "mvn -T 2 -Dmaven.test.failure.ignore clean install"
                }
            }
        }

        stage ('Analysis') {
            steps {
                junit '**/target/surefire-reports/TEST-*.xml'
            }
        }
    }

    post {
        success {
            archiveArtifacts artifacts: "**/target/spring*.jar, **/target/java*.jar", fingerprint:true, onlyIfSuccessful:true
        }
    }
}