提交 86d45483 编写于 作者: K Kohsuke Kawaguchi

if the maven home is incorrect, detect the problem more gracefully.

上级 e73e870f
......@@ -24,6 +24,7 @@ package hudson.maven;
* THE SOFTWARE.
*/
import hudson.AbortException;
import hudson.remoting.Callable;
import java.io.File;
......@@ -53,7 +54,15 @@ public class MavenVersionCallable
{
try
{
return MavenEmbedderUtils.getMavenVersion( new File(mavenHome) );
File home = new File(mavenHome);
if(!home.isDirectory())
{
if (home.exists())
throw new AbortException("Maven Home "+home+" is not a directory");
else
throw new AbortException("Maven Home "+home+" doesn't exist");
}
return MavenEmbedderUtils.getMavenVersion(home);
}
catch ( MavenEmbedderException e )
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册