Newer
Older
microservice / Jenkinsfile
properties([[$class: 'BuildDiscarderProperty', 
                     strategy: [$class: 'LogRotator', numToKeepStr: '5']]])

node {
   def mvnHome
   stage('Preparation') { 
       checkout scm
       mvnHome = tool name: 'MAVEN-3.0', type: 'maven'
       env.JAVA_HOME = tool name: 'JDK8', type: 'jdk'
   }

   stage('Build') {
       if (isUnix()) {
           sh "'${mvnHome}/bin/mvn' -T 2 -Dmaven.test.failure.ignore clean install site:site"
       } else {
           bat(/"${mvnHome}\bin\mvn" -T 2 -Dmaven.test.failure.ignore clean install site:site/)
       }
   }

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

   stage('Result') {
        archiveArtifacts artifacts: "**/target/spring*.jar, **/target/java*.jar", fingerprint:true, onlyIfSuccessful:true
   }
}