// Declarative // pipeline { agent any stages { stage('Test') { steps { /* `make check` returns non-zero on test failures, * using `true` to allow the Pipeline to continue nonetheless */ sh 'make check || true'  ① junit '**/target/*.xml'  ② } } } } // Script // node { /* .. snip .. */ stage('Test') { /* `make check` returns non-zero on test failures, * using `true` to allow the Pipeline to continue nonetheless */ sh 'make check || true'  ① junit '**/target/*.xml'  ② } /* .. snip .. */ } ① Using an inline shell conditional ( sh 'make || true' ) ensures that the  sh  step always sees a zero exit code, giving the  junit  step the opportunity to capture and process the test reports. Alternative approaches to this are covered in more detail in the [handling-failures] section below. ② junit  captures and associates the JUnit XML files matching the inclusion pattern ( */target/ .xml ). Deployment can imply a variety of steps, depending on the project or organization requirements, and may be anything from publishing built artifacts to an Artifactory server, to pushing code to a production system. At this stage of the example Pipeline, both the "Build" and "Test" stages have successfully executed. In essense, the "Deploy" stage will only execute assuming previous stages completed successfully, otherwise the Pipeline would have exited early. Deploy 33