Plugin 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.

Requires Hudson 1.376 or newer (1.357 or newer for version 1.8 or older).
Change Log
Version 1.12 (Jan 30, 2011)
- Restore ability to copy artifacts from maven project that were archived with a post-build step (instead of maven automatic archiving), that was lost in 1.11. (issue #7752)
Version 1.11 (Nov 7, 2010)
- Copy artifacts from all modules/configurations when a maven/matrix project is selected. (issue #7752)
- Add extension point for how files are copied from source to target, allowing other plugins to override default implementation using Hudson's FilePath class. (issue #7753)
- Add note about limitation in copy-from-workspace feature. (issue #7751)
Version 1.10 (Oct 10, 2010)
- Add option to copy from workspace of latest completed build. (issue #7130)
Note: source and target jobs cannot both run on slave nodes; at least one must be on the master node.
- Strip newlines in XML form of build selector parameters, to avoid breaking ant execution on windows. (issue #7680)
Version 1.9 (Sep 28, 2010)
- Now supports selecting a build based on its permalink, which allows this plugin to work nicely with the promoted builds plugin.
Version 1.8 (Jul 18, 2010)
- Add parameter expansion in selecting a specific build number. (issue #6972)
Version 1.7 (May 12, 2010)
- Add support for using a build parameter to specify the BuildSelector used for copying artifacts.
Version 1.6 (May 8, 2010)
- Make build environment available to BuildSelectors.
Version 1.5 (May 5, 2010)
- Add Japanese localization.
Version 1.3 (May 2, 2010)
- Add option to flatten directories when copying, so all artifacts from source project are copied directly into target directory. (issue #6345)
- Add option to make the copy optional, so build doesn't fail if build, workspace, or matching artifact is not found. This release changes the default behavior when build is found but no artifacts were copied (now a build failure, previously just reported "0 files copied").
- Add some help text about copying artifacts from Maven modules. (issue #6355)
Version 1.2 (Apr 17, 2010)
- Add parameter expansion in name of project to copy from and add some help text about copying from matrix jobs. (issue #6242)
- Add extension point for how to select which build to copy artifacts from. Includes selectors for latest successful/stable build or latest saved ("keep forever") build.
Other plugins known to implement this extension: Promoted Builds Simple Plugin
Version 1.1 (Mar 18, 2010)
- Add workaround for hanging-slave issue to avoid problem until issue #5977 is fixed in Hudson core. (issue #5934)
Version 1.0 (Mar 7, 2010)
Comments (23)
Apr 07, 2010
Don Ross says:
Can you provide usage instructions for this plugin? Especially what syntax to u...Can you provide usage instructions for this plugin? Especially what syntax to use for complex environments like multi-configuration projects.
May 05, 2010
Hendrik Millner says:
The new version 1.5 also fails a build, if no artifacts were copied because all ...The new version 1.5 also fails a build, if no artifacts were copied because all formerly copied artifacts were still there and up to date.
May 05, 2010
Alan Harder says:
oops, I'll mention that above.. the fix is already on the way..oops, I'll mention that above.. the fix is already on the way..
May 25, 2010
Leo von Klenze says:
Thank you for this very useful plugin! Just one question: Is it possible to...Thank you for this very useful plugin!
Just one question: Is it possible to select the project by build parameter, too? I have very large test data (> 10GB) and more than one configuration for building my binaries (e.g. Release jobs). If I can select the project by build parameter I would need only one test job (and not 10GB diskspace for every testjob ;-) )
Thank you very much!
Jun 03, 2010
Alan Harder says:
Please file requests in the issue tracker.. they're easily forgotten here, thank...Please file requests in the issue tracker.. they're easily forgotten here, thanks!
Jun 18, 2010
Mark Walling says:
If you are trying to copy automatically archived artifacts from a Maven build, y...If you are trying to copy automatically archived artifacts from a Maven build, you need to refer to the module as JOBNAME/MODULENAME.
See http://issues.hudson-ci.org/browse/HUDSON-6355 or the help for project name.
Thought it would be worth mentioning here, since it took myself a bit of time to find it.
Sep 08, 2010
Rick Herrick says:
Is it possible to modify the pathing of the artifacts to be copied? I have a Fl...Is it possible to modify the pathing of the artifacts to be copied? I have a Flex build that puts its output into a target folder in the workspace, build/flex-build. Underneath that folder, there's some various Flex support files, framework libraries, our portal control, then some folders like com/ourcompany/project1, com/ourcompany/project2, etc. Each of the project1, project2 folders contains a number of Flex SWFs.
When the Flex build completes, in the Post-build Actions, I check Archive the artifacts, then in the Files to archive box I put: build/flex-build/**. That ends up archiving everything in there properly, but it has the build/flex-build path at the beginning of it.
The problem really bites me when I try to use copy artifact to copy these into my Java build. I have a web app with a /flex folder. What I really want is everything in build/flex-build to be copied into my flex folder. So for Artifacts to copy, I specify build/flex-build/*, then for *Target directory I specify the path to the flex folder in the Java build.
But instead of getting the contents of the flex-build folder copied into the flex web app folder, what I get is the top-level build folder in the flex folder, meaning that all the stuff I want in /flex is actually two levels down.
So is there any way to say I want to use these artifacts starting at this folder level? Or something like that?
I think in the short-term I'm going to have to modify the build out folder for the Flex build, but if I'm missing something, please inform me!
Sep 08, 2010
Alan Harder says:
Sorry, I don't really follow.. if you specify a target directory, everything tha...Sorry, I don't really follow.. if you specify a target directory, everything that is copied should be place inside that target. Please file an issue with specific steps if you think it's not doing this..
Oct 28, 2010
Alexandru Dancu says:
Did you ever tried to copy a 50MB binary file? It fails every time: http://hud...Did you ever tried to copy a 50MB binary file? It fails every time:
http://hudson.pastebin.com/e4cw49zg
Nov 01, 2010
Alan Harder says:
Try an older Hudson version until HUDSON-7745 is fixed.Try an older Hudson version until HUDSON-7745 is fixed.
Nov 01, 2010
stijn says:
I really like this plugin, but cannot get it to work with matrix projects.. Trie...I really like this plugin, but cannot get it to work with matrix projects.. Tried all options but I always get 'copied 0 artifacts'.
project A has axes x and y
project B has the same axes
Any pointers on this? Should I create an issue? It doesn't seem that hard to implement (at least, not when A and B have the same axes..)
Right now I have to use the cumbersome
wget http://server/job/dlls/lastSuccessfulBuild/configuration=%configuration%,platform=%platform%/artifact/*zip*/art.zip
7za x art.zip
copy archive_bin*.* _bin\
rmdir /Q /S archive
del art.zip
Nov 01, 2010
Alan Harder says:
Click on the help icon for the project name you're copying from.. it describes h...Click on the help icon for the project name you're copying from.. it describes here how to select the particular matrix configuration to copy from, including the case for matrix-to-matrix with same axes (if you enter just the name for the matrix project, without a particular configuration, you'll always get 0 artifacts copied, as the parent has no artifacts.. there is work in progress to copy artifacts from ALL configurations in this case.. see HUDSON-7752).
Nov 01, 2010
stijn says:
(bonks head on desk) that was the sole help icon I didn't click.. thanks, works ...(bonks head on desk) that was the sole help icon I didn't click.. thanks, works great!
Nov 12, 2010
Patrick Renaud says:
I want to use the Copy Artifact plugin in connection with the Promoted Builds pl...I want to use the Copy Artifact plugin in connection with the Promoted Builds plugin, but it seems like my use case isn't covered yet, or I miss something fundamental. The problem scenario is described in the following thread:
http://hudson.361315.n4.nabble.com/How-to-promote-artifacts-of-a-previous-build-td3038590.html#a3038590
In essence, I want to retrieve the artifacts of the build being promoted in order to push them elsewhere (say to an FTP server, or whatever). This sounded to me like the perfect combination of three plugins in order: promoted-build, copy-artifact and ftppublisher. My problem is that I can't find a way to tell the copy-artifact plugin for which build I want to get the artifacts. All I have, from the promoted-builds plugin, is a reference to the build itself, via $PROMOTED_URL. Would it make sense to add a function to copy-artifacts so it could consume the $PROMOTED_URL information supplied by the promoted-build plugin?
Currently, I have to write custom steps in the build promotion logic for retrieving the wanted artifacts (using wget) -- thus in effect not using the copy-artifacts plugin at all, which is a pity.
Nov 18, 2010
Alan Harder says:
I haven't used Promoted Builds, but I thought Kohsuke added the copy-by-permalin...I haven't used Promoted Builds, but I thought Kohsuke added the copy-by-permalink build selector in copyartifact plugin for copying from promoted builds.. does that plugin add permalinks you can reference in a copyartifact build step?
Nov 15, 2010
Steven Nemetz says:
I used this plugin before and it worked great. But in a new job it is not workin...I used this plugin before and it worked great. But in a new job it is not working.
I'm getting the following error.
ERROR: Failed to copy artifacts from EVEREST.MAIN with filter: EVEREST/MAIN/EVEREST.MAIN.BLD.*.MashupGenome.tar.gz
hudson.util.IOException2: hudson.util.IOException2: Not in GZIP format
The file that should be copied is 110MB
In older versions of hudson, I've had this plugin copy many larger files without a problem.
I'm not sure why I'm getting a gzip error for copying a binary file
Any ideas on how to fix this would be appreciated
Nov 18, 2010
Alan Harder says:
This is HUDSON-7745 which should be fixed in Hudson 1.384.This is HUDSON-7745 which should be fixed in Hudson 1.384.
Nov 19, 2010
stijn says:
unfortunately, it is not..unfortunately, it is not..
Jan 26, 2011
Leo von Klenze says:
Hello, how can I copy the "main" artifacts from another job? I can copy the art...Hello,
how can I copy the "main" artifacts from another job? I can copy the artifacts from an sepcified module and from all modules. But I didn't find a valid input to copy the artifacts that I see on the main site of the job.
Thanks,
Leo
Aug 02, 2011
Alan Harder says:
Click the help icons in the build step to get some information about selecting ...Click the help
icons in the build step to get some information about selecting projects/modules/artifacts. Try the user's Mailing List, Mailing List if you still need assistance, thanks.
Feb 04, 2011
Jeremy Friesner says:
Hi all, I'm using the Copy Artifacts plugin simply to gather daily-build artifa...Hi all,
I'm using the Copy Artifacts plugin simply to gather daily-build artifacts from various jobs together into a single location, and it's working well for that.
One small problem, though, is that artifacts from previous daily builds aren't deleted before the Copy Artifacts steps begin, which means that old files tend to build up in the artifacts directory, which I want to avoid.
Is there some way to tell my job to delete any existing artifacts before copying in the new ones?
Thanks,
Jeremy
Feb 17, 2011
Gustavo Gonnet says:
Hi Jeremy, I use an Execute Shell step (with an rm command) before the Copy Art...Hi Jeremy,
I use an Execute Shell step (with an rm command) before the Copy Artifacts for cleanup.
Perhaps you can use the same approach?
Regards,
Gustavo.
Feb 09, 2011
Fall Guy says:
I am using this plugin for the first time. When it runs, I get the following err...I am using this plugin for the first time. When it runs, I get the following error message:Unable to access workspace for artifact copy. Slave node offline?
I have a very simple hudson setup and there are no 'slave nodes'.
Any ideas on what is causing this error?