提交 20e4d0bd 编写于 作者: K kohsuke

when a lifecycle is forked, we end up getting multiple "redeploy artifacts" actions

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34833 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f7c1bbfd
......@@ -249,6 +249,14 @@ public class Fingerprinter extends Recorder implements Serializable {
onLoad(); // make compact
}
public void add(Map<String,String> moreRecords) {
Map<String,String> r = new HashMap<String, String>(record);
r.putAll(moreRecords);
record = ImmutableMap.copyOf(r);
ref = null;
onLoad();
}
public String getIconFileName() {
return "fingerprint.gif";
}
......
......@@ -128,6 +128,11 @@ public class MavenArtifactArchiver extends MavenReporter {
// record the action
build.executeAsync(new MavenBuildProxy.BuildCallable<Void,IOException>() {
public Void call(MavenBuild build) throws IOException, InterruptedException {
// if a build forks lifecycles, this method can be called multiple times
List<MavenArtifactRecord> old = Util.filter(build.getActions(), MavenArtifactRecord.class);
if (!old.isEmpty())
build.getActions().removeAll(old);
MavenArtifactRecord mar = new MavenArtifactRecord(build,pomArtifact,mainArtifact,attachedArtifacts);
build.addAction(mar);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册