提交 4f900f60 编写于 作者: C Christoph Kutzinski

[JENKINS-11592] trying to find out where the NPE is originated

上级 ee38d15b
...@@ -1816,6 +1816,8 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run ...@@ -1816,6 +1816,8 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
* <p> * <p>
* Unlike earlier {@link #getEnvVars()}, this map contains the whole environment, * Unlike earlier {@link #getEnvVars()}, this map contains the whole environment,
* not just the overrides, so one can introspect values to change its behavior. * not just the overrides, so one can introspect values to change its behavior.
*
* @return the map with the environmental variables. Never <code>null</code>.
* @since 1.305 * @since 1.305
*/ */
public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException { public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException {
......
...@@ -46,6 +46,7 @@ import hudson.model.Computer; ...@@ -46,6 +46,7 @@ import hudson.model.Computer;
import hudson.model.Environment; import hudson.model.Environment;
import hudson.model.Executor; import hudson.model.Executor;
import hudson.model.Fingerprint; import hudson.model.Fingerprint;
import hudson.model.Node;
import hudson.model.ParameterDefinition; import hudson.model.ParameterDefinition;
import hudson.model.ParametersAction; import hudson.model.ParametersAction;
import hudson.model.ParametersDefinitionProperty; import hudson.model.ParametersDefinitionProperty;
...@@ -162,8 +163,15 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven ...@@ -162,8 +163,15 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
if (mvn == null) if (mvn == null)
throw new AbortException(Messages.MavenModuleSetBuild_NoMavenConfigured()); 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("M2_HOME", mvn.getHome());
envs.put("PATH+MAVEN", mvn.getHome() + "/bin"); envs.put("PATH+MAVEN", mvn.getHome() + "/bin");
return envs; return envs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册