Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-9203] in light of 9c965617b3b385ef65eaf50860865c05a114…
…a01d, I think the proper fix is to define a mechanism to abort with status.

Originally-Committed-As: a3354b12cfc5f554487b59f35e5a0bdbce8861a6
  • Loading branch information
kohsuke committed Jun 17, 2011
1 parent efc08b9 commit a8a6efc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main/java/hudson/maven/Maven3Builder.java
Expand Up @@ -27,6 +27,7 @@
import hudson.maven.MavenBuild.ProxyImpl2;
import hudson.maven.util.ExecutionEventLogger;
import hudson.model.BuildListener;
import hudson.model.Executor;
import jenkins.model.Jenkins;
import hudson.model.Result;
import hudson.remoting.Channel;
Expand Down Expand Up @@ -141,7 +142,7 @@ public Result call() throws IOException {
g.cancel(true);
// FIXME messages
listener.getLogger().println("build aborted");
return Result.ABORTED;
return Executor.currentExecutor().abortResult();
} catch (ExecutionException e) {
// FIXME messages
e.printStackTrace(listener.error("async build failed"));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/hudson/maven/MavenBuilder.java
Expand Up @@ -29,6 +29,7 @@
import hudson.maven.agent.PluginManagerListener;
import hudson.maven.reporters.SurefireArchiver;
import hudson.model.BuildListener;
import hudson.model.Executor;
import hudson.model.Result;
import hudson.remoting.Callable;
import hudson.remoting.Channel;
Expand Down Expand Up @@ -178,7 +179,7 @@ public Result call() throws IOException {
for (Future<?> g : futures)
g.cancel(true);
listener.getLogger().println(Messages.MavenBuilder_Aborted());
return Result.ABORTED;
return Executor.currentExecutor().abortResult();
} catch (ExecutionException e) {
e.printStackTrace(listener.error(Messages.MavenBuilder_AsyncFailed()));
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/hudson/maven/MavenModuleSetBuild.java
Expand Up @@ -43,6 +43,7 @@
import hudson.model.Cause.UpstreamCause;
import hudson.model.Computer;
import hudson.model.Environment;
import hudson.model.Executor;
import hudson.model.Fingerprint;
import jenkins.model.Jenkins;
import hudson.model.ParameterDefinition;
Expand Down Expand Up @@ -746,7 +747,7 @@ protected Result doRun(final BuildListener listener) throws Exception {
}
}
} catch (InterruptedException e) {
r = ABORTED;
r = Executor.currentExecutor().abortResult();
throw e;
} finally {
if (r != null) {
Expand All @@ -771,7 +772,7 @@ protected Result doRun(final BuildListener listener) throws Exception {
return Result.FAILURE;
} catch (InterruptedIOException e) {
e.printStackTrace(listener.error("Aborted Maven execution for InterruptedIOException"));
return Result.ABORTED;
return Executor.currentExecutor().abortResult();
} catch (IOException e) {
e.printStackTrace(listener.error(Messages.MavenModuleSetBuild_FailedToParsePom()));
return Result.FAILURE;
Expand Down

0 comments on commit a8a6efc

Please sign in to comment.