-
Bug
-
Resolution: Unresolved
-
Major
If you are using elastic cloud slaves, and a Maven installation has no fixed location on the master (instead provided using tool installers on slaves only), redeployment may fail with an unhelpful error such as
ERROR: Couldn't find path for tool 'Maven 3.0.4' java.lang.NullPointerException at java.io.File.<init>(Unknown Source) at hudson.tasks.Maven$MavenInstallation.getHomeDir(Maven.java:485) at hudson.maven.MavenUtil.createEmbedder(MavenUtil.java:114) at hudson.maven.reporters.MavenAbstractArtifactRecord$1.perform(MavenAbstractArtifactRecord.java:226) at hudson.model.TaskThread.run(TaskThread.java:127)
It would be better to allocate a slave to run redeployment on, or at a minimum fail with a polite error message (AbortException perhaps) saying that the original environment can no longer be reconstructed.
Null safety issues here: getHomeDir should presumably return null if it is unset; createEmbedder should try to fall back to finding a Maven installation which exists on the master; MavenEmbedderRequest.getMavenHome must be documented to be potentially null.