提交 9f53cf3d 编写于 作者: A abayer

[FIXED HUDSON-6033] BuildWrapper teardowns couldn't get result of Maven2 project builds

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34980 71c3de6d-444a-0410-be80-ed276b4c234a
上级 8d9b9cca
......@@ -367,6 +367,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
protected Result doRun(final BuildListener listener) throws Exception {
PrintStream logger = listener.getLogger();
Result r = null;
try {
EnvVars envVars = getEnvironment(listener);
MavenInstallation mvn = project.getMaven();
......@@ -394,7 +395,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
for( BuildWrapper w : wrappers) {
Environment e = w.setUp(MavenModuleSetBuild.this, launcher, listener);
if(e==null)
return Result.FAILURE;
return (r = Result.FAILURE);
buildEnvironments.add(e);
e.buildEnvVars(envVars); // #3502: too late for getEnvironment to do this
}
......@@ -474,13 +475,17 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
try {
mpa = new MavenProbeAction(project,process.channel);
addAction(mpa);
return process.call(builder);
r = process.call(builder);
return r;
} finally {
builder.end(launcher);
getActions().remove(mpa);
process.discard();
}
} finally {
if (r != null) {
setResult(r);
}
// tear down in reverse order
boolean failed=false;
for( int i=buildEnvironments.size()-1; i>=0; i-- ) {
......@@ -493,7 +498,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
}
}
return null;
return r;
} catch (AbortException e) {
if(e.getMessage()!=null)
listener.error(e.getMessage());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册