Skip to content
Permalink
Browse files

Merge pull request #36 from jenkinsci/JENKINS-43101

[JENKINS-43101] Fix “The fingerprint xyz did not match any of the recorded data."
  • Loading branch information...
cyrille-leclerc committed Apr 10, 2017
2 parents 01e8690 + e49725f commit d2c73586d6c6caf5dddeb62df2eec8c4d34478c7
@@ -2,11 +2,13 @@

import hudson.FilePath;
import hudson.Launcher;
import hudson.model.FingerprintMap;
import hudson.model.Run;
import hudson.model.StreamBuildListener;
import hudson.model.TaskListener;
import hudson.tasks.Fingerprinter;
import jenkins.model.ArtifactManager;
import jenkins.model.Jenkins;
import jenkins.util.BuildListenerAdapter;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor;
@@ -97,6 +99,14 @@ public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsE
artifactManager.archive(workspace, launcher, new BuildListenerAdapter(listener), artifactsToArchive);

// FINGERPRINT GENERATED MAVEN ARTIFACT
FingerprintMap fingerprintMap = Jenkins.getActiveInstance().getFingerprintMap();
for (Map.Entry<String, String> artifactToFingerprint : artifactsToFingerPrint.entrySet()) {
String artifactPathInArchiveZone = artifactToFingerprint.getKey();
String artifactMd5 = artifactToFingerprint.getValue();
fingerprintMap.getOrCreate(run, artifactPathInArchiveZone, artifactMd5);
}

// add action
Fingerprinter.FingerprintAction fingerprintAction = run.getAction(Fingerprinter.FingerprintAction.class);
if (fingerprintAction == null) {
run.addAction(new Fingerprinter.FingerprintAction(run, artifactsToFingerPrint));

0 comments on commit d2c7358

Please sign in to comment.
You can’t perform that action at this time.