[FIXED HUDSON-3502] Maven builds were not correctly using build wrappers.

Module set builds were running wrappers but ignoring any environment variables they tried to set.
Individual module builds (e.g. "Run in parallel" checked, or just click Build Now on a module) were ignoring wrappers altogether.
Either way, $DISPLAY was not being set when the XVNC plugin was used.
Note: there is a certain amount of code duplication in the various doRun implementations which could perhaps be factored out somewhere.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17323 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
jglick committed 2009-04-21 00:44:04 +00:00
1 parent cc68d4a182
commit 3dd283c4d1
2 files changed
+20 -4

No files matched your search

@@ -330,10 +330,11 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
buildEnvironments = new ArrayList<Environment>();
for( BuildWrapper w : wrappers) {
BuildWrapper.Environment e = w.setUp((AbstractBuild)MavenModuleSetBuild.this, launcher, listener);
BuildWrapper.Environment e = w.setUp(MavenModuleSetBuild.this, launcher, listener);
if(e==null)
return Result.FAILURE;
buildEnvironments.add(e);
e.buildEnvVars(envVars); // #3502: too late for getEnvironment to do this
}
if(!preBuild(listener, project.getPublishers()))
@@ -380,7 +381,7 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
// tear down in reverse order
for( int i=buildEnvironments.size()-1; i>=0; i-- )
buildEnvironments.get(i)
.tearDown((AbstractBuild)MavenModuleSetBuild.this, listener);
.tearDown(MavenModuleSetBuild.this, listener);
buildEnvironments = null;
}
}