From 7684abb19c4104461b65deabc52aece980508ff7 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Sat, 18 May 2024 14:11:47 -0700 Subject: [PATCH] [JENKINS-73259] Migrate Winstone from EE 8 to EE 9 --- README.md | 2 +- pom.xml | 18 +++++++++--------- src/main/java/winstone/HostConfiguration.java | 6 +++--- .../testApplication/filters/TimingFilter.java | 14 +++++++------- .../filters/WriteAfterServletFilter.java | 14 +++++++------- .../listeners/SessionListener.java | 10 +++++----- .../servlets/AcceptFormServlet.java | 8 ++++---- .../servlets/CountRequestsServlet.java | 10 +++++----- .../servlets/UnavailableServlet.java | 10 +++++----- 9 files changed, 46 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index fe83999d..d802097f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # What is Winstone? Winstone is a command line interface around Jetty 12.0.x, which implements -Servlet 4.0 (JakartaEE 8/`javax.servlet.*`), WebSocket/JSR-356, and HTTP/2 support. It is used as the default +Servlet 5.0 (JakartaEE 9/`jakarta.servlet.*`), WebSocket/JSR-356, and HTTP/2 support. It is used as the default embedded servlet container in Jenkins (via the `executable` package in the `war` module) and can be used by any other web applications that wants to be self-contained. diff --git a/pom.xml b/pom.xml index 8e1a1355..dddd5af0 100644 --- a/pom.xml +++ b/pom.xml @@ -53,8 +53,8 @@ import - org.eclipse.jetty.ee8 - jetty-ee8-bom + org.eclipse.jetty.ee9 + jetty-ee9-bom ${jetty.version} pom import @@ -115,17 +115,17 @@ jetty-util - org.eclipse.jetty.ee8 - jetty-ee8-servlet + org.eclipse.jetty.ee9 + jetty-ee9-servlet - org.eclipse.jetty.ee8 - jetty-ee8-webapp + org.eclipse.jetty.ee9 + jetty-ee9-webapp - org.eclipse.jetty.ee8.websocket - jetty-ee8-websocket-jetty-server - + org.eclipse.jetty.ee9.websocket + jetty-ee9-websocket-jetty-server + org.eclipse.jetty.http2 diff --git a/src/main/java/winstone/HostConfiguration.java b/src/main/java/winstone/HostConfiguration.java index fca6314c..e9cb6cc1 100644 --- a/src/main/java/winstone/HostConfiguration.java +++ b/src/main/java/winstone/HostConfiguration.java @@ -8,6 +8,7 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import jakarta.servlet.SessionTrackingMode; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -29,9 +30,8 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.logging.Level; -import javax.servlet.SessionTrackingMode; -import org.eclipse.jetty.ee8.webapp.WebAppContext; -import org.eclipse.jetty.ee8.websocket.server.config.JettyWebSocketServletContainerInitializer; +import org.eclipse.jetty.ee9.webapp.WebAppContext; +import org.eclipse.jetty.ee9.websocket.server.config.JettyWebSocketServletContainerInitializer; import org.eclipse.jetty.security.LoginService; import org.eclipse.jetty.server.RequestLog; import org.eclipse.jetty.server.Server; diff --git a/src/test/java/winstone/testApplication/filters/TimingFilter.java b/src/test/java/winstone/testApplication/filters/TimingFilter.java index 28aaba5b..ed68def5 100644 --- a/src/test/java/winstone/testApplication/filters/TimingFilter.java +++ b/src/test/java/winstone/testApplication/filters/TimingFilter.java @@ -6,15 +6,15 @@ */ package winstone.testApplication.filters; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import java.io.IOException; import java.util.Enumeration; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; /** * Simple timing and request dumping test filter diff --git a/src/test/java/winstone/testApplication/filters/WriteAfterServletFilter.java b/src/test/java/winstone/testApplication/filters/WriteAfterServletFilter.java index 61decab9..3905c8a9 100644 --- a/src/test/java/winstone/testApplication/filters/WriteAfterServletFilter.java +++ b/src/test/java/winstone/testApplication/filters/WriteAfterServletFilter.java @@ -1,13 +1,13 @@ package winstone.testApplication.filters; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; public class WriteAfterServletFilter implements Filter { diff --git a/src/test/java/winstone/testApplication/listeners/SessionListener.java b/src/test/java/winstone/testApplication/listeners/SessionListener.java index ad6cbe2b..12ec6812 100644 --- a/src/test/java/winstone/testApplication/listeners/SessionListener.java +++ b/src/test/java/winstone/testApplication/listeners/SessionListener.java @@ -6,11 +6,11 @@ */ package winstone.testApplication.listeners; -import javax.servlet.http.HttpSessionActivationListener; -import javax.servlet.http.HttpSessionAttributeListener; -import javax.servlet.http.HttpSessionBindingEvent; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; +import jakarta.servlet.http.HttpSessionActivationListener; +import jakarta.servlet.http.HttpSessionAttributeListener; +import jakarta.servlet.http.HttpSessionBindingEvent; +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionListener; /** * Logs messages when any session event is received diff --git a/src/test/java/winstone/testApplication/servlets/AcceptFormServlet.java b/src/test/java/winstone/testApplication/servlets/AcceptFormServlet.java index 32ee7bbb..2a9f2735 100644 --- a/src/test/java/winstone/testApplication/servlets/AcceptFormServlet.java +++ b/src/test/java/winstone/testApplication/servlets/AcceptFormServlet.java @@ -1,11 +1,11 @@ package winstone.testApplication.servlets; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; public class AcceptFormServlet extends HttpServlet { diff --git a/src/test/java/winstone/testApplication/servlets/CountRequestsServlet.java b/src/test/java/winstone/testApplication/servlets/CountRequestsServlet.java index 59e99d76..4745eb70 100644 --- a/src/test/java/winstone/testApplication/servlets/CountRequestsServlet.java +++ b/src/test/java/winstone/testApplication/servlets/CountRequestsServlet.java @@ -6,12 +6,12 @@ */ package winstone.testApplication.servlets; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletOutputStream; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; /** * Simple test servlet that counts the number of times it has been requested, diff --git a/src/test/java/winstone/testApplication/servlets/UnavailableServlet.java b/src/test/java/winstone/testApplication/servlets/UnavailableServlet.java index 3e9a5e97..35a5663b 100644 --- a/src/test/java/winstone/testApplication/servlets/UnavailableServlet.java +++ b/src/test/java/winstone/testApplication/servlets/UnavailableServlet.java @@ -6,13 +6,13 @@ */ package winstone.testApplication.servlets; +import jakarta.servlet.ServletException; +import jakarta.servlet.UnavailableException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.Writer; -import javax.servlet.ServletException; -import javax.servlet.UnavailableException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; /** * Used to test the unavailable exception processing