pipeline{ agent none options { skipDefaultCheckout() } stages { stage('Build') { stages{ stage('Check out') { steps { checkout scm stash(name: 'hello_world', includes: '**', excludes: '**/.git/**') } } stage('Maven build') { steps { unstash 'hello_world' sh(script: 'mvn -B -f pom.xml clean package -Pdeploy -pl :hello-world -am') stash(name: 'war', includes: '**') } } stage('Create Build Config'){ when { expression { openshift.withCluster(){ return !openshift.selector("bc", "") } } } } } } } }