diff --git a/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java b/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java
index ef58bf7ca8f..faed559fa2f 100644
--- a/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java
+++ b/jetty-alpn/jetty-alpn-java-server/src/test/java/org/eclipse/jetty/alpn/java/server/JDK9ALPNTest.java
@@ -19,6 +19,7 @@
package org.eclipse.jetty.alpn.java.server;
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@@ -26,6 +27,7 @@ import java.nio.charset.StandardCharsets;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
+import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -85,10 +87,10 @@ public class JDK9ALPNTest
@Test
public void testClientNotSupportingALPNServerSpeaksDefaultProtocol() throws Exception
{
- startServer(new AbstractHandler.ErrorDispatchHandler()
+ startServer(new AbstractHandler()
{
@Override
- protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
baseRequest.setHandled(true);
}
@@ -127,10 +129,10 @@ public class JDK9ALPNTest
@Test
public void testClientSupportingALPNServerSpeaksNegotiatedProtocol() throws Exception
{
- startServer(new AbstractHandler.ErrorDispatchHandler()
+ startServer(new AbstractHandler()
{
@Override
- protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
baseRequest.setHandled(true);
}
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/EmptyServerHandler.java b/jetty-client/src/test/java/org/eclipse/jetty/client/EmptyServerHandler.java
index 1287ed445e1..be44bc5d798 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/EmptyServerHandler.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/EmptyServerHandler.java
@@ -26,10 +26,10 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
-public class EmptyServerHandler extends AbstractHandler.ErrorDispatchHandler
+public class EmptyServerHandler extends AbstractHandler
{
@Override
- protected final void doNonErrorHandle(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ public final void handle(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
jettyRequest.setHandled(true);
service(target, jettyRequest, request, response);
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
index 1fc4158ceca..0330431a0de 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
@@ -534,10 +534,10 @@ public class HttpClientTest extends AbstractHttpClientServerTest
@ArgumentsSource(ScenarioProvider.class)
public void test_ExchangeIsComplete_OnlyWhenBothRequestAndResponseAreComplete(Scenario scenario) throws Exception
{
- start(scenario, new AbstractHandler.ErrorDispatchHandler()
+ start(scenario, new AbstractHandler()
{
@Override
- protected void doNonErrorHandle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
+ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException
{
baseRequest.setHandled(true);
response.setContentLength(0);
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
index dae686bf0ea..0bbb6c169b7 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
@@ -143,6 +143,7 @@ public abstract class ScanningAppProvider extends ContainerLifeCycle implements
_scanner.setRecursive(_recursive);
_scanner.setFilenameFilter(_filenameFilter);
_scanner.setReportDirs(true);
+ _scanner.setScanDepth(1); //consider direct dir children of monitored dir
_scanner.addListener(_scannerListener);
addBean(_scanner);
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
index 8c26d9e4da8..1b5cedf25ca 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/WebAppProvider.java
@@ -81,6 +81,11 @@ public class WebAppProvider extends ScanningAppProvider
String lowername = name.toLowerCase(Locale.ENGLISH);
File file = new File(dir, name);
+ Resource r = Resource.newResource(file);
+ if (getMonitoredResources().contains(r) && r.isDirectory())
+ {
+ return false;
+ }
// ignore hidden files
if (lowername.startsWith("."))
diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java
index b58fa8a8b51..49401e5e45d 100644
--- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java
+++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/SettingsBodyParser.java
@@ -83,6 +83,11 @@ public class SettingsBodyParser extends BodyParser
@Override
public boolean parse(ByteBuffer buffer)
+ {
+ return parse(buffer, getStreamId(), getBodyLength());
+ }
+
+ private boolean parse(ByteBuffer buffer, int streamId, int bodyLength)
{
while (buffer.hasRemaining())
{
@@ -91,9 +96,9 @@ public class SettingsBodyParser extends BodyParser
case PREPARE:
{
// SPEC: wrong streamId is treated as connection error.
- if (getStreamId() != 0)
+ if (streamId != 0)
return connectionFailure(buffer, ErrorCode.PROTOCOL_ERROR.code, "invalid_settings_frame");
- length = getBodyLength();
+ length = bodyLength;
settings = new HashMap<>();
state = State.SETTING_ID;
break;
@@ -216,6 +221,13 @@ public class SettingsBodyParser extends BodyParser
return true;
}
+ /**
+ *
Parses the given buffer containing the whole body of a {@code SETTINGS} frame
+ * (without header bytes), typically from the {@code HTTP2-Settings} header.
+ *
+ * @param buffer the buffer containing the body of {@code SETTINGS} frame
+ * @return the {@code SETTINGS} frame from the parsed body bytes
+ */
public static SettingsFrame parseBody(final ByteBuffer buffer)
{
AtomicReference frameRef = new AtomicReference<>();
@@ -234,7 +246,7 @@ public class SettingsBodyParser extends BodyParser
}
});
if (buffer.hasRemaining())
- parser.parse(buffer);
+ parser.parse(buffer, 0, buffer.remaining());
else
parser.emptyBody(buffer);
return frameRef.get();
diff --git a/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/EmptyServerHandler.java b/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/EmptyServerHandler.java
index 595f77ca933..fc7a42fa533 100644
--- a/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/EmptyServerHandler.java
+++ b/jetty-http2/http2-http-client-transport/src/test/java/org/eclipse/jetty/http2/client/http/EmptyServerHandler.java
@@ -26,10 +26,10 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
-public class EmptyServerHandler extends AbstractHandler.ErrorDispatchHandler
+public class EmptyServerHandler extends AbstractHandler
{
@Override
- protected final void doNonErrorHandle(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ public final void handle(String target, Request jettyRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
jettyRequest.setHandled(true);
service(target, jettyRequest, request, response);
diff --git a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java
index ff8a8c482af..baed46f3e4d 100644
--- a/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java
+++ b/jetty-http2/http2-server/src/test/java/org/eclipse/jetty/http2/server/HTTP2CServerTest.java
@@ -125,7 +125,7 @@ public class HTTP2CServerTest extends AbstractServerTest
"Host: localhost\r\n" +
"Connection: something, else, upgrade, HTTP2-Settings\r\n" +
"Upgrade: h2c\r\n" +
- "HTTP2-Settings: \r\n" +
+ "HTTP2-Settings: AAEAAEAAAAIAAAABAAMAAABkAAQBAAAAAAUAAEAA\r\n" +
"\r\n").getBytes(StandardCharsets.ISO_8859_1));
output.flush();
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java
index 8aa3b28ceab..e207efb31a5 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/AbstractWebAppMojo.java
@@ -26,9 +26,9 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
+import java.nio.file.PathMatcher;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -57,7 +57,8 @@ import org.eclipse.jetty.security.LoginService;
import org.eclipse.jetty.server.RequestLog;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandler;
-import org.eclipse.jetty.util.PathWatcher;
+import org.eclipse.jetty.util.IncludeExcludeSet;
+import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.resource.Resource;
/**
@@ -847,22 +848,18 @@ public abstract class AbstractWebAppMojo extends AbstractMojo
* Configure any extra files, directories or patterns thereof for the
* scanner to watch for changes.
*
- * @param scanner PathWatcher that notices changes in files and dirs.
+ * @param scanner Scanner that notices changes in files and dirs.
+ * @throws IOException
*/
- protected void configureScanTargetPatterns(PathWatcher scanner)
+ protected void configureScanTargetPatterns(Scanner scanner) throws IOException
{
//handle the extra scan patterns
if (scanTargetPatterns != null)
{
- for (ScanTargetPattern p:scanTargetPatterns)
+ for (ScanTargetPattern p : scanTargetPatterns)
{
- PathWatcher.Config config = new PathWatcher.Config(p.getDirectory().toPath());
- config.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
- for (String pattern:p.getExcludes())
- config.addExcludeGlobRelative(pattern);
- for (String pattern:p.getIncludes())
- config.addIncludeGlobRelative(pattern);
- scanner.watch(config);
+ IncludeExcludeSet includesExcludes = scanner.addDirectory(p.getDirectory().toPath());
+ p.configureIncludesExcludeSet(includesExcludes);
}
}
}
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunMojo.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunMojo.java
index 6e02fb8f190..237ee261eff 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunMojo.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunMojo.java
@@ -19,6 +19,8 @@
package org.eclipse.jetty.maven.plugin;
import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
import java.util.Date;
import java.util.List;
@@ -30,8 +32,10 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.eclipse.jetty.util.IncludeExcludeSet;
import org.eclipse.jetty.util.PathWatcher;
import org.eclipse.jetty.util.PathWatcher.PathWatchEvent;
+import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.webapp.WebAppContext;
@@ -68,7 +72,7 @@ public class JettyRunMojo extends AbstractUnassembledWebAppMojo
/**
* Scanner to check for files changes to cause redeploy
*/
- protected PathWatcher scanner;
+ protected Scanner scanner;
/**
* Only one of the following will be used, depending the mode
@@ -154,9 +158,11 @@ public class JettyRunMojo extends AbstractUnassembledWebAppMojo
// start scanning for changes, or wait for linefeed on stdin
if (scan > 0)
{
- scanner = new PathWatcher();
+ scanner = new Scanner();
+ scanner.setScanInterval(scan);
+ scanner.setScanDepth(Scanner.MAX_SCAN_DEPTH); //always fully walk directory hierarchies
+ scanner.setReportExistingFilesOnStartup(false);
configureScanner();
- scanner.setNotifyExistingOnStart(false);
scanner.start();
}
else
@@ -194,27 +200,13 @@ public class JettyRunMojo extends AbstractUnassembledWebAppMojo
{
throw new MojoExecutionException("Error forming scan list", e);
}
-
- scanner.addListener(new PathWatcher.EventListListener()
+ scanner.addListener(new Scanner.BulkListener()
{
- @Override
- public void onPathWatchEvents(List events)
+ public void filesChanged(List changes)
{
try
{
- boolean reconfigure = false;
- if (events != null)
- {
- for (PathWatchEvent e:events)
- {
- if (e.getPath().equals(project.getFile().toPath()))
- {
- reconfigure = true;
- break;
- }
- }
- }
-
+ boolean reconfigure = changes.contains(project.getFile().getCanonicalPath());
restartWebApp(reconfigure);
}
catch (Exception e)
@@ -230,77 +222,95 @@ public class JettyRunMojo extends AbstractUnassembledWebAppMojo
if (webApp.getDescriptor() != null)
{
Resource r = Resource.newResource(webApp.getDescriptor());
- scanner.watch(r.getFile().toPath());
+ scanner.addFile(r.getFile().toPath());
}
if (webApp.getJettyEnvXml() != null)
- scanner.watch(new File(webApp.getJettyEnvXml()).toPath());
+ scanner.addFile(new File(webApp.getJettyEnvXml()).toPath());
if (webApp.getDefaultsDescriptor() != null)
{
if (!WebAppContext.WEB_DEFAULTS_XML.equals(webApp.getDefaultsDescriptor()))
- scanner.watch(new File(webApp.getDefaultsDescriptor()).toPath());
+ scanner.addFile(new File(webApp.getDefaultsDescriptor()).toPath());
}
if (webApp.getOverrideDescriptor() != null)
{
- scanner.watch(new File(webApp.getOverrideDescriptor()).toPath());
+ scanner.addFile(new File(webApp.getOverrideDescriptor()).toPath());
}
File jettyWebXmlFile = findJettyWebXmlFile(new File(webAppSourceDirectory,"WEB-INF"));
if (jettyWebXmlFile != null)
{
- scanner.watch(jettyWebXmlFile.toPath());
+ scanner.addFile(jettyWebXmlFile.toPath());
}
//make sure each of the war artifacts is added to the scanner
for (Artifact a:mavenProjectHelper.getWarPluginInfo().getWarArtifacts())
{
- scanner.watch(a.getFile().toPath());
+ File f = a.getFile();
+ if (a.getFile().isDirectory())
+ scanner.addDirectory(f.toPath());
+ else
+ scanner.addFile(f.toPath());
}
//set up any extra files or dirs to watch
configureScanTargetPatterns(scanner);
- scanner.watch(project.getFile().toPath());
+ scanner.addFile(project.getFile().toPath());
if (webApp.getTestClasses() != null && webApp.getTestClasses().exists())
{
- PathWatcher.Config config = new PathWatcher.Config(webApp.getTestClasses().toPath());
- config.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
+ Path p = webApp.getTestClasses().toPath();
+ IncludeExcludeSet includeExcludeSet = scanner.addDirectory(p);
if (scanTestClassesPattern != null)
{
- for (String p:scanTestClassesPattern.getExcludes())
- config.addExcludeGlobRelative(p);
- for (String p:scanTestClassesPattern.getIncludes())
- config.addIncludeGlobRelative(p);
+ for (String s : scanTestClassesPattern.getExcludes())
+ {
+ if (!s.startsWith("glob:"))
+ s = "glob:" + s;
+ includeExcludeSet.exclude(p.getFileSystem().getPathMatcher(s));
+ }
+ for (String s : scanTestClassesPattern.getIncludes())
+ {
+ if (!s.startsWith("glob:"))
+ s = "glob:" + s;
+ includeExcludeSet.include(p.getFileSystem().getPathMatcher(s));
+ }
}
- scanner.watch(config);
}
if (webApp.getClasses() != null && webApp.getClasses().exists())
{
- PathWatcher.Config config = new PathWatcher.Config(webApp.getClasses().toPath());
- config.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
+ Path p = webApp.getClasses().toPath();
+ IncludeExcludeSet includeExcludes = scanner.addDirectory(p);
if (scanClassesPattern != null)
{
- for (String p:scanClassesPattern.getExcludes())
- config.addExcludeGlobRelative(p);
+ for (String s : scanClassesPattern.getExcludes())
+ {
+ if (!s.startsWith("glob:"))
+ s = "glob:" + s;
+ includeExcludes.exclude(p.getFileSystem().getPathMatcher(s));
+ }
- for (String p:scanClassesPattern.getIncludes())
- config.addIncludeGlobRelative(p);
-
- }
- scanner.watch(config);
+ for (String s : scanClassesPattern.getIncludes())
+ {
+ if (!s.startsWith("glob:"))
+ s = "glob:" + s;
+ includeExcludes.include(p.getFileSystem().getPathMatcher(s));
+ }
+ }
}
if (webApp.getWebInfLib() != null)
{
- for (File f:webApp.getWebInfLib())
+ for (File f : webApp.getWebInfLib())
{
- PathWatcher.Config config = new PathWatcher.Config(f.toPath());
- config.setRecurseDepth(PathWatcher.Config.UNLIMITED_DEPTH);
- scanner.watch(config);
+ if (f.isDirectory())
+ scanner.addDirectory(f.toPath());
+ else
+ scanner.addFile(f.toPath());
}
}
}
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunWarMojo.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunWarMojo.java
index a758da692bf..d45d4e6d278 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunWarMojo.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyRunWarMojo.java
@@ -18,6 +18,7 @@
package org.eclipse.jetty.maven.plugin;
+import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
@@ -29,8 +30,7 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.eclipse.jetty.util.PathWatcher;
-import org.eclipse.jetty.util.PathWatcher.PathWatchEvent;
+import org.eclipse.jetty.util.Scanner;
import org.eclipse.jetty.util.StringUtil;
/**
@@ -65,7 +65,7 @@ public class JettyRunWarMojo extends AbstractWebAppMojo
/**
* Scanner to check for files changes to cause redeploy
*/
- protected PathWatcher scanner;
+ protected Scanner scanner;
protected JettyEmbedder embedder;
protected JettyForker forker;
protected JettyDistroForker distroForker;
@@ -155,9 +155,11 @@ public class JettyRunWarMojo extends AbstractWebAppMojo
// start scanning for changes, or wait for linefeed on stdin
if (scan > 0)
{
- scanner = new PathWatcher();
+ scanner = new Scanner();
+ scanner.setScanInterval(scan);
+ scanner.setScanDepth(Scanner.MAX_SCAN_DEPTH); //always fully walk directory hierarchies
+ scanner.setReportExistingFilesOnStartup(false);
configureScanner();
- scanner.setNotifyExistingOnStart(false);
scanner.start();
}
else
@@ -186,36 +188,33 @@ public class JettyRunWarMojo extends AbstractWebAppMojo
public void configureScanner() throws MojoExecutionException
{
- scanner.watch(project.getFile().toPath());
- scanner.watch(war);
-
- //set up any extra files or dirs to watch
- configureScanTargetPatterns(scanner);
-
- scanner.addListener(new PathWatcher.EventListListener()
+ try
{
- @Override
- public void onPathWatchEvents(List events)
+ scanner.addFile(project.getFile().toPath());
+ scanner.addFile(war);
+
+ //set up any extra files or dirs to watch
+ configureScanTargetPatterns(scanner);
+ scanner.addListener(new Scanner.BulkListener()
{
- try
+ public void filesChanged(List changes)
{
- boolean reconfigure = false;
- for (PathWatchEvent e:events)
+ try
{
- if (e.getPath().equals(project.getFile().toPath()))
- {
- reconfigure = true;
- break;
- }
+ boolean reconfigure = changes.contains(project.getFile().getCanonicalPath());
+ restartWebApp(reconfigure);
+ }
+ catch (Exception e)
+ {
+ getLog().error("Error reconfiguring/restarting webapp after change in watched files",e);
}
- restartWebApp(reconfigure);
}
- catch (Exception e)
- {
- getLog().error("Error reconfiguring/restarting webapp after change in watched files",e);
- }
- }
- });
+ });
+ }
+ catch (IOException e)
+ {
+ throw new MojoExecutionException("Error configuring scanner", e);
+ }
}
public void restartWebApp(boolean reconfigure) throws Exception
@@ -288,7 +287,7 @@ public class JettyRunWarMojo extends AbstractWebAppMojo
}
default:
{
- throw new IllegalStateException("Unrecognized run type " +deployMode);
+ throw new IllegalStateException("Unrecognized run type " + deployMode);
}
}
getLog().info("Restart completed.");
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanPattern.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanPattern.java
index 61fb6c166ac..a4fb84e6790 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanPattern.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanPattern.java
@@ -24,7 +24,7 @@ import java.util.List;
/**
* ScanPattern
*
- * A pattern of includes and excludes.
+ * Ant-style pattern of includes and excludes.
*/
public class ScanPattern
{
diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanTargetPattern.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanTargetPattern.java
index 567a66113ba..b0a6c1f2c29 100644
--- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanTargetPattern.java
+++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/ScanTargetPattern.java
@@ -19,9 +19,13 @@
package org.eclipse.jetty.maven.plugin;
import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
import java.util.Collections;
import java.util.List;
+import org.eclipse.jetty.util.IncludeExcludeSet;
+
/**
* ScanTargetPattern
*
@@ -87,4 +91,21 @@ public class ScanTargetPattern
{
return (_pattern == null ? Collections.emptyList() : _pattern.getExcludes());
}
+
+ public void configureIncludesExcludeSet(IncludeExcludeSet includesExcludes)
+ {
+ for (String include:getIncludes())
+ {
+ if (!include.startsWith("glob:"))
+ include = "glob:" + include;
+ includesExcludes.include(_directory.toPath().getFileSystem().getPathMatcher(include));
+ }
+
+ for (String exclude:getExcludes())
+ {
+ if (!exclude.startsWith("glob:"))
+ exclude = "glob:" + exclude;
+ includesExcludes.exclude(_directory.toPath().getFileSystem().getPathMatcher(exclude));
+ }
+ }
}
diff --git a/jetty-osgi/jetty-osgi-httpservice/src/main/java/org/eclipse/jetty/osgi/httpservice/HttpServiceErrorPageErrorHandler.java b/jetty-osgi/jetty-osgi-httpservice/src/main/java/org/eclipse/jetty/osgi/httpservice/HttpServiceErrorPageErrorHandler.java
index 85e22fb065c..0f34e781810 100644
--- a/jetty-osgi/jetty-osgi-httpservice/src/main/java/org/eclipse/jetty/osgi/httpservice/HttpServiceErrorPageErrorHandler.java
+++ b/jetty-osgi/jetty-osgi-httpservice/src/main/java/org/eclipse/jetty/osgi/httpservice/HttpServiceErrorPageErrorHandler.java
@@ -49,7 +49,7 @@ public class HttpServiceErrorPageErrorHandler extends ErrorPageErrorHandler
@Override
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
- throws IOException
+ throws IOException, ServletException
{
if (HttpServiceErrorHandlerHelper.getCustomErrorHandler() != null)
{
diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml
index 16cfef78863..af6e5b32e47 100644
--- a/jetty-server/pom.xml
+++ b/jetty-server/pom.xml
@@ -79,6 +79,12 @@
${project.version}
test
+
+ org.eclipse.jetty
+ jetty-util-ajax
+ ${project.version}
+ test
+
diff --git a/jetty-server/src/main/config/etc/jetty-ssl-context.xml b/jetty-server/src/main/config/etc/jetty-ssl-context.xml
index cf4aa60ffd4..d4a3d1e3d5d 100644
--- a/jetty-server/src/main/config/etc/jetty-ssl-context.xml
+++ b/jetty-server/src/main/config/etc/jetty-ssl-context.xml
@@ -13,10 +13,10 @@
/
-
+
-
+
/
@@ -29,6 +29,7 @@
+