mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
[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
This commit is contained in:
1 parent
8d9b9ccad5
commit
9f53cf3dbe
1 file changed
+8
-3
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user