The following plugin provides functionality available through
Pipeline-compatible steps. Read more about how to integrate steps into your
Pipeline in the
section of the
For a list of other such plugins, see the
Pipeline Steps Reference
step([$class: 'TargetPlatformPublisher']): Archive and publish an Eclipse Target Platform
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',
You can use wildcards like 'module/dist/**/*.zip'. See the includes attribute of Ant fileset
for the exact format -- except that "," (comma
) is the only supported separator. The base directory is the workspace
. You can only archive files that are located in your workspace.
Here are some examples of usage for pipeline:
- How to archive multiple artifacts from a specific folder:
archiveArtifacts artifacts: 'target/*.jar'
- How to archive multiple artifacts with different patterns:
archiveArtifacts artifacts: 'target/*.jar, target/*.war'
- How to archive multiple nested artifacts:
archiveArtifacts artifacts: '**/*.jar'
Optionally specify the 'excludes' pattern, such as "foo/bar/**/*". Use "," to set a list of patterns. A file that matches this mask will not be archived even if it matches the mask specified in 'files to archive' section.
Normally, a build fails if archiving returns zero artifacts. This option allows the archiving process to return nothing without failing the build. Instead, the build will simply throw a warning.
Artifact archiver uses Ant
org.apache.tools.ant.DirectoryScanner which by default is case sensitive. For instance, if the job produces *.hpi files, pattern "**/*.HPI" will fail to find them.
This option can be used to disable case sensitivity. When it's unchecked, pattern "**/*.HPI" will match any *.hpi files, or pattern "**/cAsEsEnSiTiVe.jar" will match a file called caseSensitive.jar.
By disabling this option all symbolic links found in the workspace will be ignored.
Was this page helpful?
Please submit your feedback about this page through this
Alternatively, if you don't wish to complete the quick form, you can simply
indicate if you found this page helpful?
See existing feedback here.