Skip to content

Commit

Permalink
[FIXED JENKINS-11592] NPE in subversion polling of Maven jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
kutzi committed Nov 15, 2011
1 parent c9958b7 commit e2d7b39
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- 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>
Expand Down
17 changes: 10 additions & 7 deletions maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
Expand Up @@ -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;
}

Expand Down

0 comments on commit e2d7b39

Please sign in to comment.