Is there any documentation/examples on the Copy Artifacts Plugin, namely the "Specified by a build parameter" option?
I'm trying to do a "join-diamond" pipeline such as in this SO question and can't figure out what to put in the Parameter Name option of the "Copy artifacts from another project" build step to get my artifacts copied properly.

All my jobs have a PL_BUILD_NUMBER parameter and I'd like to use it to select which build to copy the artifacts from.
This mailing list post says the parameter must be an XML. So I tried this :
BUILD_SELECTOR=<SpecificBuildSelector><buildNumber>$PL_BUILD_NUMBER</buildNumber></SpecificBuildSelector>
but it did not work. I get this exception in the log:
java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1035)
at hudson.plugins.copyartifact.BuildSelectorParameter.getSelectorFromXml(BuildSelectorParameter.java:80)
at hudson.plugins.copyartifact.ParameterizedBuildSelector.getBuild(ParameterizedBuildSelector.java:52)
at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:280)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
at hudson.model.Run.execute(Run.java:1740)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:233)
What should I put?
There's also the "This build is parametrized --> Build selector for Copy Artifact" that I don't know if I should use it...
Thanks!
You are mixing Specified by a build parameter and Specific build. It's not clear which one you are asking about.
For Specified by a build parameter, you need to configure in two places:
BUILD_SELECTOR).BUILD_SELECTOR, if you called your parameter BUILD_SELECTOR as well, you don't need to change anything.The value of BUILD_SELECTOR parameter will change greatly based on what you select at parameter screen just before build. You can see its possible values by printing the value of the parameter as a test (echo %BUILD_SELECTOR% on Windows, echo $BUILD_SELECTOR on *nix) and then manually running the build and trying different selectors.
Specifically, the value of:
<SpecificBuildSelector><buildNumber>123</buildNumber></SpecificBuildSelector>
will be used when the user selects Specific build on the parameter screen, and enters value 123
If you need to set this parameter value from outside the job (for example from a script or Parameterized Trigger plugin) you would need to follow this particular structure, depending on the type of the selection you want.
Edit: After re-reading your question and your actual requirement (which is not what the question title is)
In your case, you don't need "Build selector for Copy Artifact" parameter. You just need:
$PL_BUILD_NUMBER (which you say you already have in the job)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With