Skip to content
Permalink
Browse files
[FIXED JENKINS-11592] NPE in subversion polling of Maven jobs
Originally-Committed-As: e2d7b399210db6333affd9a0e6deac5a94a4d300
  • Loading branch information
kutzi committed Nov 15, 2011
1 parent 6060b62 commit 1b1907177ba41d0193d574db59793138b95064c2
Showing with 10 additions and 7 deletions.
  1. +10 −7 src/main/java/hudson/maven/MavenModuleSetBuild.java
@@ -165,15 +165,18 @@ public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedE


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

Computer computer = Computer.currentComputer();
if (computer != null) { // just in case were not in a build
Node node = computer.getNode();
if (node != null) {
mvn = mvn.forNode(node, log);

envs.put("M2_HOME", mvn.getHome());
envs.put("PATH+MAVEN", mvn.getHome() + "/bin");
}
}
mvn = mvn.forNode(node, log);

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

0 comments on commit 1b19071

Please sign in to comment.