Invoke the blamer before the result is attached to the build.
package hudson.plugins.analysis.core;
import java.io.IOException;
+import java.util.Set;
import hudson.FilePath;
import hudson.Launcher;
@@ -11,6 +12,7 @@ import hudson.model.Run;
import hudson.plugins.analysis.util.*;
+import hudson.plugins.analysis.util.model.FileAnnotation;
import hudson.tasks.BuildStep;
/**
@@ -65,8 +67,6 @@ public abstract class HealthAwarePublisher extends HealthAwareRecorder {
BuildResult result;
try {
result = perform(run, workspace, logger);
- AbstractBlamer blamer = BlameFactory.createBlamer(run, workspace, logger);
- blamer.blame(result.getAnnotations());
Run<?, ?> referenceBuild = result.getHistory().getReferenceBuild();
@@ -93,6 +93,11 @@ public abstract class HealthAwarePublisher extends HealthAwareRecorder {
return true;
}
+ protected void blame(final Set<FileAnnotation> annotations, final Run<?, ?> run, final FilePath workspace, final PluginLogger logger) {
+ BlameInterface blamer = BlameFactory.createBlamer(run, workspace, logger);
+ blamer.blame(annotations);
+ }
+
/**
* Will be invoked after the build result has been evaluated.
*
