Newer
Older
jsonicwar / 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"
       } else {
           bat(/"${mvnHome}\bin\mvn" -T 2 -Dmaven.test.failure.ignore clean install/)
       }
   }

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