提交 e2d7b399 编写于 作者: C Christoph Kutzinski

[FIXED JENKINS-11592] NPE in subversion polling of Maven jobs

上级 c9958b7e
......@@ -55,6 +55,9 @@ Upcoming changes</a>
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Fixed NPE in Subversion polling of Maven jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11592">issue 11592</a>)
<li class=rfe>
CLI jar now has the version number in the manifest as well as the "-version" option.
</ul>
......
......@@ -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;
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册