Issue #5480 - Fail in jetty-maven-plugin if unable to create temp directory.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2020-10-20 16:29:22 -05:00
parent 0e98c370fd
commit 227dd47157
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 6 additions and 2 deletions

View File

@ -49,7 +49,6 @@ import org.eclipse.jetty.server.ShutdownMonitor;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.util.PathWatcher;
import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.resource.Resource;
@ -559,7 +558,12 @@ public abstract class AbstractJettyMojo extends AbstractMojo
File target = new File(project.getBuild().getDirectory());
File tmp = new File(target, "tmp");
if (!tmp.exists())
tmp.mkdirs();
{
if (!tmp.mkdirs())
{
throw new MojoFailureException("Unable to create temp directory: " + tmp);
}
}
webApp.setTempDirectory(tmp);
}