Skip to content
Permalink
Browse files
[JENKINS-11592] trying to find out where the NPE is originated
Originally-Committed-As: 4f900f60d447e0e371557faef33630899434b747
  • Loading branch information
kutzi committed Nov 8, 2011
1 parent c5012a6 commit 2ff8a00099da1de4a96d0e137c3409e08444cd5c
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/main/java/hudson/maven/MavenModuleSetBuild.java
@@ -46,6 +46,7 @@
import hudson.model.Environment;
import hudson.model.Executor;
import hudson.model.Fingerprint;
import hudson.model.Node;
import hudson.model.ParameterDefinition;
import hudson.model.ParametersAction;
import hudson.model.ParametersDefinitionProperty;
@@ -162,8 +163,15 @@ public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedE
if (mvn == null)
throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured());

mvn = mvn.forEnvironment(envs).forNode(
Computer.currentComputer().getNode(), log);

mvn = mvn.forEnvironment(envs);
Node node = Computer.currentComputer().getNode();
if (node == null) {
log.getLogger().println("WARNING: cannot get current node: "+Computer.currentComputer());
return envs;
}
mvn = mvn.forNode(node, log);

envs.put("M2_HOME", mvn.getHome());
envs.put("PATH+MAVEN", mvn.getHome() + "/bin");
return envs;

0 comments on commit 2ff8a00

Please sign in to comment.