} // Script // stage('Build') { node { checkout scm sh 'make' stash includes: '**/target/*.jar', name: 'app' ① } } stage('Test') { node('linux') { ② checkout scm try { unstash 'app' ③ sh 'make check' } finally { junit '**/target/*.xml' } } node('windows') { checkout scm try { unstash 'app' bat 'make check' ④ } finally { junit '**/target/*.xml' } } } 

① The stash  step allows capturing files matching an inclusion pattern ( */target/ .jar ) for reuse within the same  Pipeline. Once the Pipeline has completed its execution, stashed files are deleted from the Jenkins master. 

② The parameter in agent / node  allows for any valid Jenkins label expression. Consult the Pipeline Syntax section for more details. 

③ unstash  will retrieve the named "stash" from the Jenkins master into the Pipeline’s current workspace. 

④ The bat  script allows for executing batch scripts on Windows-based platforms. 

## Optional step arguments 

Pipeline follows the Groovy language convention of allowing parentheses to be omitted around method arguments. 

Many Pipeline steps also use the named-parameter syntax as a shorthand for creating a Map in Groovy, which uses the syntax [key1: value1, key2: value2] . Making statements like the following 

