Jenkins : Abandoned: Preview for Copy Artifact 2.0


This page explains new features and changes of copyartifact-2.0 I plan.
The work is in progress at and .


  • The configuration page of copyArtifact 1.x (current)
  • The configuration page of copyArtifact 2.0 (new)

Purpose of copyartifact-2.0

  • New features breaking compatibilities.
    • There are many issues for copyartifact (JIRA), but it's not easy to fix them without breaking compatibilities.
  • Easy to extend
    • Introduces more flexible design to make it easy to extend features (that is, extendable without breaking compatibilities)

Problems in copyartifact-1.x

  • Inconsistent / incomplete permission checks (JENKINS-28247, JENKINS-24888, JENKINS-23475)
    • Checks permissions at configuration time when projects are specified without variables.
    • Checks permissions at runtime when projects are specified with variables.
    • This results following problems:
      • Hard for users to understand the behavior.
      • Cannot check permissions for WorkflowJobs.
      • Can bypass permission checks using WebAPI / CLI.
    • Designed like this as legacy Jenkins doesn't provide authorizing mechanisms for builds.
  • Cannot configure complicated conditions for selecting builds (JENKINS-28206)
    • Cannot use different selectors together.
  • Few diagnostic messages (JENKINS-11336, JENKINS-24889)
  • Doesn't support ArtifactManager (JENKINS-22637, JENKINS-17494)
    • Can copy artifacts only archived with "Archive Artifacts" built in Jenkins core.
  • Difficult to add new features preserving binary compatibilities.
    • Adding new parameters breaks binary compatibilities.
    • There are plugins depending on copyartifact and they gets broken when broken binary compatibilities.

New features of copyartifact-2.0

  • Build-filter based configuration (JENKINS-24890)
    • You can specify additional conditions to builds selected by a build selector.
    • You can use multiple filters together.
    • This enables you to select a build like this: Latest one that is stable, a downstream of build A, and built with a build parameter P=blahblah...
  • Fallback build selector (JENKINS-24886)
    • You can specify to try multiple selectors consequently.
  • You can select a "Copy Operation" which decides what to do for the selected build.
    • This is introduced as ArtifactManager based on VirtualFile is incompatible with the existing artifact mechanism based on FilePath.
    • See #Copy Operation for details.
  • More console outputs.
    • Selectors and filters can output console logs.
    • You can check "Debug output" to enable diagnostic logs.

Design of copyartifact-2.0


Automatic configuration migration

Old-style build selectors

  • Some plugins provide their own build selectors. Those build selectors are based on the design of copyartifact-1.0.
  • Copyartifact-2.0 tries to handle those selectors in the legacy way.
  • Though this should work almost all cases as expected, some selectors doesn't work correctly.
    • Especially for a case a selector specifies to copy files from its own source, like WorkspaceSelector. In that case, the plugin should provide its own Copy Operation.

Built-in Components in copyartifact-2.0

Build Selector

Build Selector

New in 2.0




Tries build selectors (and additional filters) consequently.



Decides a selector to use at runtime from the build parameter.



Specifies a build with a permalink.



Specifies a build with its build number or build name



Selects builds with specific statuses.



Selects builds triggering this build (renamed from TriggeredBuildSelector removing its fallbacking behavior.)

Build Filter

Standard Build Filter

Build Filter

New in 2.0




Accepts builds that are downstream of a specified build.



Accepts any builds. Does nothing and the default filter.



Accepts builds with specified build parameters.



Decides a filter to use at runtime from the build parameter.



Accepts builds marked "keep forever". (was SavedBuildSelector)

Logical Build Filter

Build Filter

New in 2.0




Accepts builds that suffice all of underlying filters.



Reverts the result of another filter.



Accepts builds that suffice any of underlying filters.

Copy Operation

Copy Operation


Copy artifact files

copy artifacts from generic ArtifactManager. This doesn't preserver file modes and symbolic links (as VirtualFile doesn't provide that feature). Doesn't support exclude filters.

Copy legacy artifact files

copy artifacts from StandardArtifactManager (works as copyartifact-1.0). This is not exposed in UI. Copy artifact files automatically switches to this internally. Support exclude filters.

Copy files from workspace

copy files from workspace of the selected build (works as WorkspaceSelector in copyartifact-1.0)

Incompatibilities and Known issues


For users

  • Permission checks are performed only at runtime.
    • Builds may fail if you don't configure appropreate runtime authorizations.

For plugins and developers

  • Copier is removed.
    • Use CopyArtifactOperation instead.
    • As long as I know, there's no plugins depending on Copier.
  • BuildSelector#getSourceDirectory is removed.
    • Use CopyArtifactOperation instead.
    • As long as I know, there's no plugins depending on BuildSelector#getSourceDirectory.

Known issues

  • TriggeringBuildSelector may cause performance issues.
    • It tracks and lists all upstream builds to enumerate upstream builds.
    • Generator pattern should be useful for this case but I couldn't find common and reliable implementation for that.
    • This would be complicated and I plan to fix this after beta releases.
  • Less compatibility for generic artifact managers (VirtualFile)
    • Doesn't support
      • Exclude filters.
      • Symbolic links.
      • File modes.
    • I plan to contribute core to have VirtualFile support these features.


copyartifact-1.x.png (image/png)
copyartifact-2.0.png (image/png)