// Declarative // pipeline { agent any stages { stage('Build') { steps { sh 'make'  ① archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true  ② } } } } // Script // node { stage('Build') { sh 'make'  ① archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true  ② } } ① The  sh  step invokes the  make  command and will only continue if a zero exit code is returned by the command. Any non-zero exit code will fail the Pipeline. ② archiveArtifacts  captures the files built matching the include pattern ( */target/ .jar ) and saves them to the Jenkins master for later retrieval. Archiving artifacts is not a substitute for using external artifact repositories such as Artifactory or Nexus and should be considered only for basic reporting and file archival. Running automated tests is a crucial component of any successful continuous delivery process. As such, Jenkins has a number of test recording, reporting, and visualization facilities provided by a number of plugins. At a fundamental level, when there are test failures, it is useful to have Jenkins record the failures for reporting and visualization in the web UI. The example below uses the  junit step, provided by the plugin:junit[JUnit plugin]. In the example below, if tests fail, the Pipeline is marked "unstable", as denoted by a yellow ball in the web UI. Based on the recorded test reports, Jenkins can also provide historical trend analysis and visualization. 32 Test TIP