This commit is contained in:
Jan Bartel 2016-07-28 15:36:02 +10:00
parent c9842c7794
commit 6a17019235
2 changed files with 21 additions and 11 deletions

View File

@ -477,7 +477,7 @@ public class JettyRunMojo extends AbstractJettyMojo
scanner.watch(project.getFile().toPath());
if (webApp.getTestClasses() != null)
if (webApp.getTestClasses() != null && webApp.getTestClasses().exists())
{
PathWatcher.Config config = new PathWatcher.Config(webApp.getTestClasses().toPath());
config.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
@ -491,7 +491,7 @@ public class JettyRunMojo extends AbstractJettyMojo
scanner.watch(config);
}
if (webApp.getClasses() != null)
if (webApp.getClasses() != null && webApp.getClasses().exists())
{
PathWatcher.Config config = new PathWatcher.Config(webApp.getClasses().toPath());
config.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);

View File

@ -98,21 +98,31 @@ public class JettyRunWarExplodedMojo extends AbstractJettyMojo
{
scanner.watch(project.getFile().toPath());
File webInfDir = new File(war,"WEB-INF");
scanner.watch(new File(webInfDir, "web.xml").toPath());
File webXml = new File(webInfDir, "web.xml");
if (webXml.exists())
scanner.watch(webXml.toPath());
File jettyWebXmlFile = findJettyWebXmlFile(webInfDir);
if (jettyWebXmlFile != null)
scanner.watch(jettyWebXmlFile.toPath());
File jettyEnvXmlFile = new File(webInfDir, "jetty-env.xml");
if (jettyEnvXmlFile.exists())
scanner.watch(jettyEnvXmlFile.toPath());
PathWatcher.Config classesConfig = new PathWatcher.Config(new File(webInfDir, "classes").toPath());
classesConfig.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
scanner.watch(classesConfig);
PathWatcher.Config libConfig = new PathWatcher.Config(new File(webInfDir, "lib").toPath());
libConfig.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
scanner.watch(libConfig);
File classes = new File(webInfDir, "classes");
if (classes.exists())
{
PathWatcher.Config classesConfig = new PathWatcher.Config(classes.toPath());
classesConfig.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
scanner.watch(classesConfig);
}
File lib = new File(webInfDir, "lib");
if (lib.exists())
{
PathWatcher.Config libConfig = new PathWatcher.Config(lib.toPath());
libConfig.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
scanner.watch(libConfig);
}
scanner.addListener(new PathWatcher.EventListListener()
{