Copy Artifact

This plugin is up for adoption! We are looking for new maintainers. Visit our Adopt a Plugin initiative for more information.

Adds a build step to copy artifacts from another project.

The plugin lets you specify which build to copy artifacts from (e.g. the last successful/stable build, by build number, or by a build parameter). You can also control the copying process by filtering the files being copied, specifying a destination directory within the target project, etc. Click the help icon on each field to learn the details, such as selecting Maven or multiconfiguration projects or using build parameters. You can also copy from the workspace of the latest completed build of the source project, instead of its artifacts. All artifacts copied are automatically fingerprinted for you.


Pipeline syntax

  • To copy artifacts from the latest stable build of "sourceproject"

    copyArtifacts(projectName: 'sourceproject');
  • To copy artifacts from the specific build of "downstream"

    def built = build('downstream');  //
    copyArtifacts(projectName: 'downstream', selector: specific("${built.number}"));
  • Parameters of copyArtifacts

    parameter type description



    the name of project (required)



    the selector to select the build to copy from. If not specified, latest stable build is used.



    comma-separated name and value pairs (name1=value1,name2=value2) to filter the build to copy from.



    ant-expression to filter artifacts to copy



    ant-expression to exclude artifacts to copy



    target directory to copy to



    ignore directory structures of artifacts



    do not fail the step even if no appropriate build is found.



    fingerprint artifacts to track builds using those artifacts. false for default if the parameter isn’t specified (Snippet Generator defaults this to true and specifies the parameter).



    useless for pipelines



    Include source build number in target path.

  • selectors

    name feature


    Latest successful build


    Specific build


    Specified by permalink


    completed build (ignoring build status)


    Latest saved build (marked "keep forever")


    Specified by a build parameter


    Upstream build that triggered this job

Configuration Notes

  • When using this plugin with a Windows agent node that is configured as a Windows service, the service should have permission to interact with desktop (select "Allow service to interact with desktop" from Jenkins Agent service properties). Otherwise you may see errors similar to this:

    ERROR: Failed to copy artifacts from ...
    hudson.util.IOException2: java.lang.IllegalAccessError: class hudson.remoting.Pipe$ConnectCommand cannot
      access its superclass hudson.remoting.Command
    at hudson.FilePath.copyRecursiveTo(
    at hudson.FilePath.copyRecursiveTo(
    at hudson.plugins.copyartifact.FilePathCopyMethod.copyAll(
  • Artifacts should be stored as archived files.

    • Copyartifact tries to copy artifacts preserving file attributes like permissions and symbolic links. Though, it may fail in some situations (like for security issues).

    • It’s highly recommended to pack files to copy into an archive file, using tar command or zip pipeline step, especially when it’s important for you to preserving file attributes or directory structures.

Permissions to copy artifact

Since version 1.44, Copy Artifact checks permissions more thoroughly in its default Production mode. If you have permission issues when upgrading from copyartifact 1.43.1 or earlier you can use Migration Mode. You should convert to Production mode as soon as possible.

When you face a following message and fail to copy artifacts, this may be caused by permission to the job with artifacts. Please read this section once.

Unable to find project for artifact copy: YOUR_PROJECT_WITH_ARTIFACTS
This may be due to incorrect project name or permission settings; see help for project name in job configuration.
Build step 'Copy artifacts from another project' marked build as failure

You can configure to allow Copy Artifact to access source jobs in the following ways.

The message will not be encountered if the "Authenticated" user group has the "job/read" permission enabled. If this issue appears on your controller, check if this configuration has recently changed.

Specify projects who can copy artifacts

  • In the job configuration pages, you can specify jobs to allow copy artifacts from that project:

  • Use copyArtifactPermission in pipelines:

    • Declarative pipeline:

      pipeline {
          agent any;
          options {
    • Scripted pipeline

      node {
  • You can specify multiple jobs separated by commas.

  • You can use wildcard character ('*') to specify name patterns.

Authorize builds as a user

  • Authorize Project plugin enables you to run builds of a project as a specific user.

    • Copy Artifact treats builds running as anonymous without authorization configurations.

  • You can resolve permission problems by running builds as a user with read permission to the project with artifacts

Migration Mode

Migration mode is available and automatically enabled for users upgrading Copy Artifact from 1.43.1 or earlier.

Migration mode performs permission checks when configuring jobs or when running builds if the name of the source job is configured with variables. This is the behavior compatible to Copy Artifact 1.43.1 or earlier.

This may cause security vulnerabilities allowing malicious users to bypass permission checks. This mode is provided only to allow users to upgrade job configurations and migrate to Production mode easily. You should migrate to Production mode as soon as you can.

Build executions that would fail in Production mode are recorded and displayed as warnings to administrators.

migration mode warnings

Administrators should check those warnings and update the job configurations to successfully use Production mode.

Migration helper

Use with declarative pipelines

One example:

stages {
    stage('Copy Archive') {
         steps {
             script {
                step ([$class: 'CopyArtifact',
                    projectName: 'Create_archive',
                    filter: "packages/infra*.zip",
                    target: 'Infra']);

What that is doing:

  • Go to the project/workspace named "Create_archive".

  • Look in the folder "packages" for the file(s) "infra*.zip".

  • Copy that file(s) into the folder "Infra", in the local workspace. Folder will be created if it doesn’t already exist.

Reporting Issues

Report issues in the Jenkins issue tracker. Please use the "How to Report an Issue" guidelines when reporting issues.

Release History

Changelogs for current releases are recorded in GitHub releases

Changelogs for previous releases are recorded in the legacy changelog.