mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
[FIXED JENKINS-11592] NPE in subversion polling of Maven jobs
This commit is contained in:
1 parent
c9958b7ee2
commit
e2d7b39921
2 files changed
+14
-8
No files matched your search
@@ -165,15 +165,18 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
|
||||
|
||||
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");
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
return envs;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user