Archives the build artifacts (for example, distribution zip files or jar
files) so that they can be downloaded later. Archived files will be accessible
from the Jenkins webpage.
Normally, Jenkins keeps artifacts for a build as long as a build log itself is
kept, but if you don't need old artifacts and would rather save disk space,
you can do so.
Note that the Maven job type automatically archives any produced Maven
artifacts. Any artifacts configured here will be archived on top of that.
Automatic artifact archiving can be disabled under the advanced Maven options.
The
Pipeline Snippet Generator
generates this example when all arguments are set to true (some arguments by
default are true):
archiveArtifacts artifacts: '**/*.txt',
allowEmptyArchive: true,
fingerprint: true,
onlyIfSuccessful: true