diff --git a/core/src/main/java/hudson/tasks/Fingerprinter.java b/core/src/main/java/hudson/tasks/Fingerprinter.java index 2f943c2dba65d002f29e7d16fd3a8bd69a4f8d5c..c2f7b2a98022ca4a22d98649d07aa5fcdbb68763 100644 --- a/core/src/main/java/hudson/tasks/Fingerprinter.java +++ b/core/src/main/java/hudson/tasks/Fingerprinter.java @@ -249,6 +249,14 @@ public class Fingerprinter extends Recorder implements Serializable { onLoad(); // make compact } + public void add(Map moreRecords) { + Map r = new HashMap(record); + r.putAll(moreRecords); + record = ImmutableMap.copyOf(r); + ref = null; + onLoad(); + } + public String getIconFileName() { return "fingerprint.gif"; } diff --git a/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactArchiver.java b/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactArchiver.java index d1749144b5c6a6a522432d87bb06ccdb01bc3043..7a98edd3a6ed30b3990c0e3b1128a10092851ba4 100644 --- a/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactArchiver.java +++ b/maven-plugin/src/main/java/hudson/maven/reporters/MavenArtifactArchiver.java @@ -128,6 +128,11 @@ public class MavenArtifactArchiver extends MavenReporter { // record the action build.executeAsync(new MavenBuildProxy.BuildCallable() { public Void call(MavenBuild build) throws IOException, InterruptedException { + // if a build forks lifecycles, this method can be called multiple times + List 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);