What is the difference between `stash/unstash` and `archiveArtifacts`?

IntermediateConceptJenkins
Answer

stash saves files temporarily to the controller during a run so another stage on a different agent can unstash them; stashes disappear when the build ends and should be small. archiveArtifacts stores files permanently with the build record so people and other jobs can download them later. For anything large, use an artifact repository or object storage rather than either, because both route data through the controller.

stash name: 'jar', includes: 'target/*.jar'
// later, on another agent
unstash 'jar'
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
All CI/CD questions

More on Jenkins