diff --git a/pom.xml b/pom.xml index 62068e9364fa..5884cba4f8d3 100644 --- a/pom.xml +++ b/pom.xml @@ -59,10 +59,6 @@ 12.0.12 10.0.24 ${jetty.client.version} - - 2.0.13 4.1.112.Final 5.6.15.Final 3.4.0 diff --git a/xwiki-platform-core/pom.xml b/xwiki-platform-core/pom.xml index 7c5c3c903581..aad824f27fbe 100644 --- a/xwiki-platform-core/pom.xml +++ b/xwiki-platform-core/pom.xml @@ -138,10 +138,79 @@ Single justification example: --> - - - - + + + revapi false positives + allowed + + + true + true + java.method.addedToInterface + .*@ com.xpn.xwiki.web.XWikiResponse + + + true + true + java.method.addedToInterface + .*@ com.xpn.xwiki.web.XWikiRequest + + + + + Move to Jakarta + highlight + + + true + true + .* + .*org.xwiki.websocket.AbstractXWikiEndpoint.* + + + true + true + .* + .*org.xwiki.container.servlet.SetThreadNameServletRequestListener.* + + + true + true + .* + .*org.xwiki.resource.servlet.ResourceReferenceHandlerServlet.* + + + true + true + .* + .*org.xwiki.resource.servlet.RoutingFilter.* + + + true + true + .* + .*org.xwiki.wysiwyg.filter.ConversionFilter.* + + + true + true + .* + .*com.xpn.xwiki.web.ActionFilter.* + + + true + true + .* + .*com.xpn.xwiki.web.HomePageRedirectServlet.* + + + true + true + .* + .*com.xpn.xwiki.web.LegacyActionServlet.* + + + diff --git a/xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/pom.xml b/xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/pom.xml index 54bf206f248f..68c7103304da 100644 --- a/xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-activeinstalls2/xwiki-platform-activeinstalls2-api/pom.xml @@ -74,9 +74,10 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api + org.testcontainers diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-core/pom.xml b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-core/pom.xml index 23e888e25a2f..987df4b926cd 100644 --- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-core/pom.xml +++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-core/pom.xml @@ -85,8 +85,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-io/pom.xml b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-io/pom.xml index 3cfbe1cbd2c9..d716f4c709d7 100644 --- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-io/pom.xml +++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-io/pom.xml @@ -68,8 +68,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-maintainer/pom.xml b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-maintainer/pom.xml index 2ef009f9e624..5f4976a6d001 100644 --- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-maintainer/pom.xml +++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-maintainer/pom.xml @@ -108,8 +108,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/pom.xml b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/pom.xml index 13100291e975..5ace36f81cf1 100644 --- a/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/pom.xml +++ b/xwiki-platform-core/xwiki-platform-annotation/xwiki-platform-annotation-rest/pom.xml @@ -64,8 +64,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/pom.xml b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/pom.xml index a5a9ea9052fe..5e20bc576d4b 100644 --- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/pom.xml @@ -51,8 +51,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-api/pom.xml b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-api/pom.xml index 5434f4e19071..df0ea0c50596 100644 --- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-api/pom.xml @@ -42,8 +42,8 @@ ${commons.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.commons diff --git a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml index dfe277e4e81a..39daef607c18 100644 --- a/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-validation/xwiki-platform-attachment-validation-default/pom.xml @@ -68,8 +68,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-captcha/xwiki-platform-captcha-jcaptcha/xwiki-platform-captcha-jcaptcha-api/pom.xml b/xwiki-platform-core/xwiki-platform-captcha/xwiki-platform-captcha-jcaptcha/xwiki-platform-captcha-jcaptcha-api/pom.xml index cc47d6380350..589e26d39f2e 100644 --- a/xwiki-platform-core/xwiki-platform-captcha/xwiki-platform-captcha-jcaptcha/xwiki-platform-captcha-jcaptcha-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-captcha/xwiki-platform-captcha-jcaptcha/xwiki-platform-captcha-jcaptcha-api/pom.xml @@ -94,8 +94,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.commons diff --git a/xwiki-platform-core/xwiki-platform-component/xwiki-platform-component-wiki/pom.xml b/xwiki-platform-core/xwiki-platform-component/xwiki-platform-component-wiki/pom.xml index d02a6733e821..f1d69c7438bd 100644 --- a/xwiki-platform-core/xwiki-platform-component/xwiki-platform-component-wiki/pom.xml +++ b/xwiki-platform-core/xwiki-platform-component/xwiki-platform-component-wiki/pom.xml @@ -81,14 +81,10 @@ - javax.servlet - javax.servlet-api - test - - - org.xwiki.commons - xwiki-commons-tool-test-component - ${commons.version} + org.xwiki.platform + xwiki-platform-test-oldcore + ${project.version} + pom test @@ -97,13 +93,6 @@ ${commons.version} test - - org.xwiki.platform - xwiki-platform-test-oldcore - ${project.version} - pom - test - diff --git a/xwiki-platform-core/xwiki-platform-configuration/xwiki-platform-configuration-default/pom.xml b/xwiki-platform-core/xwiki-platform-configuration/xwiki-platform-configuration-default/pom.xml index cf22935b1ee1..7d8b787bb82a 100644 --- a/xwiki-platform-core/xwiki-platform-configuration/xwiki-platform-configuration-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-configuration/xwiki-platform-configuration-default/pom.xml @@ -91,10 +91,6 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-portlet/src/main/java/org/xwiki/container/portlet/PortletApplicationContext.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-portlet/src/main/java/org/xwiki/container/portlet/PortletApplicationContext.java index e4c090b5a275..31963188e436 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-portlet/src/main/java/org/xwiki/container/portlet/PortletApplicationContext.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-portlet/src/main/java/org/xwiki/container/portlet/PortletApplicationContext.java @@ -66,6 +66,6 @@ public File getTemporaryDirectory() { // Section PLT.10.3 from the Portlet 1.0 specification says that this should be available. // FIXME: why is this using a servlet specifications variable name ? Is that really valid for a portlet ? - return (File) this.portletContext.getAttribute("javax.servlet.context.tempdir"); + return (File) this.portletContext.getAttribute("jakarta.servlet.context.tempdir"); } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/pom.xml b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/pom.xml index 062687af06a2..2726ace7ccbe 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/pom.xml +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/pom.xml @@ -35,6 +35,10 @@ 0.15 + + jakarta.servlet + jakarta.servlet-api + org.xwiki.commons xwiki-commons-component-default @@ -71,8 +75,9 @@ ${project.version} - javax.servlet - javax.servlet-api + org.xwiki.commons + xwiki-commons-jakartabridge-servlet + ${commons.version} diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/HttpServletUtils.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/HttpServletUtils.java index e80ce49627a6..24628886a34b 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/HttpServletUtils.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/HttpServletUtils.java @@ -22,15 +22,17 @@ import java.net.MalformedURLException; import java.net.URL; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.lang3.StringUtils; import org.apache.http.HeaderElement; import org.apache.http.message.BasicHeader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xwiki.container.servlet.internal.ForwardedHeader; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * Various helpers around the {@link HttpServletRequest} and {@link HttpServletResponse} API. @@ -82,8 +84,11 @@ private HttpServletUtils() * * @param servletRequest the servlet request input * @return the URL as close as possible from what the client used + * @throws MalformedURLException when an invalid URL was received + * @since 42.0.0 */ - public static URL getSourceURL(HttpServletRequest servletRequest) + @Unstable + public static URL getSourceURL(HttpServletRequest servletRequest) throws MalformedURLException { URL baseURL = getSourceBaseURL(servletRequest); @@ -96,12 +101,7 @@ public static URL getSourceURL(HttpServletRequest servletRequest) path.append(servletRequest.getQueryString()); } - try { - return new URL(baseURL, path.toString()); - } catch (MalformedURLException e) { - // Not really supposed to happen - throw new RuntimeException("XWiki received an invalid URL path or query string", e); - } + return new URL(baseURL, path.toString()); } /** @@ -113,8 +113,11 @@ public static URL getSourceURL(HttpServletRequest servletRequest) * * @param servletRequest the servlet request input * @return the URL as close as possible from what the client used + * @throws MalformedURLException when an invalid URL was received + * @since 42.0.0 */ - public static URL getSourceBaseURL(HttpServletRequest servletRequest) + @Unstable + public static URL getSourceBaseURL(HttpServletRequest servletRequest) throws MalformedURLException { StringBuilder builder = new StringBuilder(); @@ -132,14 +135,9 @@ public static URL getSourceBaseURL(HttpServletRequest servletRequest) } } - private static URL getFinalBaseURL(HttpServletRequest servletRequest) + private static URL getFinalBaseURL(HttpServletRequest servletRequest) throws MalformedURLException { - try { - return new URL(servletRequest.getScheme(), servletRequest.getRemoteHost(), servletRequest.getRemotePort(), - ""); - } catch (MalformedURLException e) { - throw new RuntimeException("XWiki received an invalid URL", e); - } + return new URL(servletRequest.getScheme(), servletRequest.getRemoteHost(), servletRequest.getRemotePort(), ""); } private static void appendScheme(HttpServletRequest request, StringBuilder builder) @@ -241,8 +239,9 @@ private static String getFirstHeaderValue(HttpServletRequest request, String key /** * @param request the servlet request input * @return true if the request explicitly disable getting resources from the cache - * @since 11.8RC1 + * @since 42.0.0 */ + @Unstable public static boolean isCacheReadAllowed(HttpServletRequest request) { String headerValue = request.getHeader(HEADER_CACHE_CONTROL); @@ -258,4 +257,58 @@ public static boolean isCacheReadAllowed(HttpServletRequest request) return true; } + + // Deprecated + + /** + * Try to extract from various http headers the URL ({@code ://[:]/[?]}) as + * close as possible to the one used by the client. + *

+ * In theory HttpServletRequest#getRequestURL() is supposed to take care of all that but depending on the + * application server and its configuration it's not always reliable. One less thing to configure. + * + * @param servletRequest the servlet request input + * @return the URL as close as possible from what the client used + */ + @Deprecated(since = "42.0.0") + public static URL getSourceURL(javax.servlet.http.HttpServletRequest servletRequest) + { + try { + return getSourceURL(JakartaServletBridge.toJakarta(servletRequest)); + } catch (MalformedURLException e) { + // Not really supposed to happen + throw new RuntimeException("XWiki received an invalid URL path or query string", e); + } + } + + /** + * Try to extract from various http headers the base URL ({@code ://[:]}) as close as possible + * to the one used by the client. + *

+ * In theory HttpServletRequest#getRequestURL() is supposed to take care of all that but depending on the + * application server and its configuration it's not always reliable. One less thing to configure. + * + * @param servletRequest the servlet request input + * @return the URL as close as possible from what the client used + */ + @Deprecated(since = "42.0.0") + public static URL getSourceBaseURL(javax.servlet.http.HttpServletRequest servletRequest) + { + try { + return getSourceBaseURL(JakartaServletBridge.toJakarta(servletRequest)); + } catch (MalformedURLException e) { + throw new RuntimeException("XWiki received an invalid URL", e); + } + } + + /** + * @param request the servlet request input + * @return true if the request explicitly disable getting resources from the cache + * @since 11.8RC1 + */ + @Deprecated(since = "42.0.0") + public static boolean isCacheReadAllowed(javax.servlet.http.HttpServletRequest request) + { + return isCacheReadAllowed(JakartaServletBridge.toJakarta(request)); + } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletContainerInitializer.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletContainerInitializer.java index f65ffb16cdd5..c63ad9ddad5e 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletContainerInitializer.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletContainerInitializer.java @@ -19,28 +19,44 @@ */ package org.xwiki.container.servlet; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.xwiki.component.annotation.Role; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; @Role public interface ServletContainerInitializer { - void initializeRequest(HttpServletRequest request, Object xwikiContext) - throws ServletContainerException; - - void initializeRequest(HttpServletRequest request) + @Deprecated(since = "42.0.0") + void initializeRequest(javax.servlet.http.HttpServletRequest request, Object xwikiContext) throws ServletContainerException; - void initializeResponse(HttpServletResponse response); - - void initializeSession(HttpServletRequest request); + @Deprecated(since = "42.0.0") + void initializeRequest(javax.servlet.http.HttpServletRequest request) throws ServletContainerException; + + @Deprecated(since = "42.0.0") + void initializeResponse(javax.servlet.http.HttpServletResponse response); + + @Deprecated(since = "42.0.0") + void initializeSession(javax.servlet.http.HttpServletRequest request); /** * @deprecated use the notion of Environment instead */ @Deprecated(since = "3.5M1") - void initializeApplicationContext(ServletContext servletContext); + void initializeApplicationContext(javax.servlet.ServletContext servletContext); + + /** + * @param request the current request + * @param response the current response + * @since 42.0.0 + */ + @Unstable + default void initializeRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletContainerException + { + initializeRequest(JakartaServletBridge.toJavax(request), JakartaServletBridge.toJavax(response)); + } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletRequest.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletRequest.java index 9a6cfc9616c4..695bf75209e0 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletRequest.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletRequest.java @@ -24,21 +24,62 @@ import java.util.List; import org.xwiki.container.Request; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; +/** + * This is the implementation of {@link Request} for {@link HttpServletRequest}. + * + * @version $Id$ + */ public class ServletRequest implements Request { - private HttpServletRequest httpServletRequest; + private final HttpServletRequest jakartaHttpServletRequest; + + private javax.servlet.http.HttpServletRequest javaxHttpServletRequest; + + /** + * @param jakartaHttpServletRequest the standard Jakarta {@link HttpServletRequest} instance + * @since 42.0.0 + */ + public ServletRequest(HttpServletRequest jakartaHttpServletRequest) + { + this.jakartaHttpServletRequest = jakartaHttpServletRequest; + } - public ServletRequest(HttpServletRequest httpServletRequest) + /** + * @param javaxHttpServletRequest the legacy Javax {@link javax.servlet.http.HttpServletRequest} instance + * @deprecated use {@link #ServletRequest(HttpServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + public ServletRequest(javax.servlet.http.HttpServletRequest javaxHttpServletRequest) { - this.httpServletRequest = httpServletRequest; + this.javaxHttpServletRequest = javaxHttpServletRequest; + this.jakartaHttpServletRequest = JakartaServletBridge.toJakarta(javaxHttpServletRequest); } - public HttpServletRequest getHttpServletRequest() + /** + * @return the standard Jakarta {@link HttpServletRequest} instance + * @since 42.0.0 + */ + public HttpServletRequest getJakartaHttpServletRequest() { - return this.httpServletRequest; + return this.jakartaHttpServletRequest; + } + + /** + * @return the legacy Javax {@link javax.servlet.http.HttpServletRequest} instance + * @deprecated use {@link #getJakartaHttpServletRequest()} instead + */ + @Deprecated(since = "42.0.0") + public javax.servlet.http.HttpServletRequest getHttpServletRequest() + { + if (this.javaxHttpServletRequest == null) { + this.javaxHttpServletRequest = JakartaServletBridge.toJavax(this.jakartaHttpServletRequest); + } + + return this.javaxHttpServletRequest; } @Override @@ -47,9 +88,9 @@ public Object getProperty(String key) Object result; // Look first in the Query Parameters and then in the Query Attributes - result = this.httpServletRequest.getParameter(key); + result = this.jakartaHttpServletRequest.getParameter(key); if (result == null) { - result = this.httpServletRequest.getAttribute(key); + result = this.jakartaHttpServletRequest.getAttribute(key); } return result; @@ -58,14 +99,14 @@ public Object getProperty(String key) @Override public List getProperties(String key) { - List result = new ArrayList(); + List result = new ArrayList<>(); // Look first in the Query Parameters and then in the Query Attributes - Object[] requestParameters = this.httpServletRequest.getParameterValues(key); + Object[] requestParameters = this.jakartaHttpServletRequest.getParameterValues(key); if (requestParameters != null) { result.addAll(Arrays.asList(requestParameters)); } - Object attributeValue = this.httpServletRequest.getAttribute(key); + Object attributeValue = this.jakartaHttpServletRequest.getAttribute(key); if (attributeValue != null) { result.add(attributeValue); } @@ -76,12 +117,12 @@ public List getProperties(String key) @Override public void setProperty(String key, Object value) { - this.httpServletRequest.setAttribute(key, value); + this.jakartaHttpServletRequest.setAttribute(key, value); } @Override public void removeProperty(String key) { - this.httpServletRequest.removeAttribute(key); + this.jakartaHttpServletRequest.removeAttribute(key); } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletResponse.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletResponse.java index d23d98b58b4b..2274ae60e5a9 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletResponse.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletResponse.java @@ -22,10 +22,11 @@ import java.io.IOException; import java.io.OutputStream; -import javax.servlet.http.HttpServletResponse; - import org.xwiki.container.RedirectResponse; import org.xwiki.container.Response; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; + +import jakarta.servlet.http.HttpServletResponse; /** * This is the implementation of {@link Response} for {@link HttpServletResponse}. @@ -34,23 +35,58 @@ */ public class ServletResponse implements Response, RedirectResponse { - private HttpServletResponse httpServletResponse; + private final HttpServletResponse jakartaHttpServletResponse; + + private javax.servlet.http.HttpServletResponse javaxHttpServletResponse; + + /** + * @param jakartaHttpServletResponse the standard Jakarta {@link HttpServletResponse} instance + * @since 42.0.0 + */ + public ServletResponse(HttpServletResponse jakartaHttpServletResponse) + { + this.jakartaHttpServletResponse = jakartaHttpServletResponse; + } - public ServletResponse(HttpServletResponse httpServletResponse) + /** + * @param javaxHttpServletResponse the legacy Javax {@link javax.servlet.http.HttpServletResponse} instance + * @deprecated use {@link #ServletResponse(HttpServletResponse)} instead + */ + @Deprecated(since = "42.0.0") + public ServletResponse(javax.servlet.http.HttpServletResponse javaxHttpServletResponse) { - this.httpServletResponse = httpServletResponse; + this.javaxHttpServletResponse = javaxHttpServletResponse; + this.jakartaHttpServletResponse = JakartaServletBridge.toJakarta(javaxHttpServletResponse); } - public HttpServletResponse getHttpServletResponse() + /** + * @return the standard Jakarta {@link HttpServletResponse} instance + * @since 42.0.0 + */ + public HttpServletResponse getJakartaHttpServletResponse() { - return this.httpServletResponse; + return this.jakartaHttpServletResponse; + } + + /** + * @return the legacy Javax {@link javax.servlet.http.HttpServletResponse} instance + * @deprecated use {@link #getJakartaHttpServletResponse()} instead + */ + @Deprecated(since = "42.0.0") + public javax.servlet.http.HttpServletResponse getHttpServletResponse() + { + if (this.javaxHttpServletResponse == null) { + this.javaxHttpServletResponse = JakartaServletBridge.toJavax(this.jakartaHttpServletResponse); + } + + return this.javaxHttpServletResponse; } @Override public OutputStream getOutputStream() throws IOException { try { - return this.httpServletResponse.getOutputStream(); + return this.jakartaHttpServletResponse.getOutputStream(); } catch (IllegalStateException ex) { return null; } @@ -59,18 +95,18 @@ public OutputStream getOutputStream() throws IOException @Override public void setContentLength(int length) { - this.httpServletResponse.setContentLength(length); + this.jakartaHttpServletResponse.setContentLength(length); } @Override public void setContentType(String mimeType) { - this.httpServletResponse.setContentType(mimeType); + this.jakartaHttpServletResponse.setContentType(mimeType); } @Override public void sendRedirect(String location) throws IOException { - this.httpServletResponse.sendRedirect(location); + this.jakartaHttpServletResponse.sendRedirect(location); } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletSession.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletSession.java index a7e17b370af6..10eabe95f1b0 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletSession.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/ServletSession.java @@ -20,20 +20,51 @@ package org.xwiki.container.servlet; import org.xwiki.container.Session; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; public class ServletSession implements Session { private HttpSession httpSession; + /** + * @param request the servlet request + * @deprecated use {@link #ServletSession(HttpServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + public ServletSession(javax.servlet.http.HttpServletRequest request) + { + this(JakartaServletBridge.toJakarta(request)); + } + + /** + * @param request the servlet request + * @since 42.0.0 + */ + @Unstable public ServletSession(HttpServletRequest request) { this.httpSession = request.getSession(true); } - public HttpSession getHttpSession() + /** + * @deprecated use {@link #getJakartaHttpSession()} instead + */ + @Deprecated(since = "42.0.0") + public javax.servlet.http.HttpSession getHttpSession() + { + return JakartaServletBridge.toJavax(this.httpSession); + } + + /** + * @return the current servlet session + * @since 42.0.0 + */ + @Unstable + public HttpSession getJakartaHttpSession() { return this.httpSession; } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/SetThreadNameServletRequestListener.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/SetThreadNameServletRequestListener.java index d4d53998a749..2f2670d1f319 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/SetThreadNameServletRequestListener.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/SetThreadNameServletRequestListener.java @@ -19,22 +19,27 @@ */ package org.xwiki.container.servlet; -import javax.servlet.ServletRequest; -import javax.servlet.ServletRequestEvent; -import javax.servlet.ServletRequestListener; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletRequestEvent; +import jakarta.servlet.ServletRequestListener; +import jakarta.servlet.http.HttpServletRequest; /** - * Make threads names created by the application server more meaningful. + * Make threads names created by the application server more meaningful. TODO When it will be possible it would be + * better to do this a component like a RequestInitializer component to work for any kind of container. Right now + * component can't really access the initial URL. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely different + * API from Java point of view. * - * TODO When it will be possible it would be better to do this a component like a RequestInitializer component to work - * for any kind of container. Right now component can't really access the initial URL. * @version $Id$ - * @since 2.0M3 + * @since 42.0.0 */ public class SetThreadNameServletRequestListener implements ServletRequestListener { - /** The name of the servlet request attribute holding the original name of the processing thread. */ + /** + * The name of the servlet request attribute holding the original name of the processing thread. + */ private static final String ORIGINAL_THREAD_NAME_ATTRIBUTE = "xwiki.thread.originalName"; @Override @@ -42,9 +47,7 @@ public void requestInitialized(ServletRequestEvent sre) { ServletRequest servletRequest = sre.getServletRequest(); - if (servletRequest instanceof HttpServletRequest) { - HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; - + if (servletRequest instanceof HttpServletRequest httpServletRequest) { String threadName = httpServletRequest.getRequestURL().toString(); if (httpServletRequest.getQueryString() != null) { @@ -65,8 +68,7 @@ public void requestInitialized(ServletRequestEvent sre) public void requestDestroyed(ServletRequestEvent sre) { ServletRequest servletRequest = sre.getServletRequest(); - if (servletRequest instanceof HttpServletRequest) { - HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; + if (servletRequest instanceof HttpServletRequest httpServletRequest) { Thread.currentThread().setName("" + httpServletRequest.getAttribute(ORIGINAL_THREAD_NAME_ATTRIBUTE)); } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextInitializer.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextInitializer.java new file mode 100644 index 000000000000..b97e2c63b1bd --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextInitializer.java @@ -0,0 +1,182 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.container.servlet; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xwiki.component.embed.EmbeddableComponentManager; +import org.xwiki.component.internal.StackingComponentEventManager; +import org.xwiki.component.manager.ComponentLookupException; +import org.xwiki.container.ApplicationContextListenerManager; +import org.xwiki.container.Container; +import org.xwiki.container.servlet.internal.HttpSessionManager; +import org.xwiki.environment.Environment; +import org.xwiki.environment.internal.ServletEnvironment; +import org.xwiki.extension.handler.ExtensionInitializer; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.observation.ObservationManager; +import org.xwiki.observation.event.ApplicationStartedEvent; +import org.xwiki.observation.event.ApplicationStoppedEvent; + +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; + +/** + * Implementation of the {@link ServletContextListener}. Initializes component manager and application context. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely + * different API from Java point of view. + * + * @version $Id$ + * @since 42.0.0 + */ +public class XWikiServletContextInitializer implements ServletContextListener +{ + /** + * Logger to use to log shutdown information (opposite of initialization). + */ + private static final Logger SHUTDOWN_LOGGER = LoggerFactory.getLogger("org.xwiki.shutdown"); + + /** The component manager used to lookup other components. */ + private EmbeddableComponentManager componentManager; + + @Override + public void contextInitialized(ServletContextEvent servletContextEvent) + { + // Initializes the Embeddable Component Manager + EmbeddableComponentManager ecm = new EmbeddableComponentManager(); + + // Initialize all the components. Note that this can fail with a Runtime Exception. This is done voluntarily so + // that the XWiki webapp will not be available if one component fails to load. It's better to fail-fast. + ecm.initialize(this.getClass().getClassLoader()); + this.componentManager = ecm; + + // This is a temporary bridge to allow non XWiki components to lookup XWiki components. + // We're putting the XWiki Component Manager instance in the Servlet Context so that it's + // available in the XWikiAction class which in turn puts it into the XWikiContext instance. + // Class that need to lookup then just need to get it from the XWikiContext instance. + // This is of course not necessary for XWiki components since they just need to implement + // the Composable interface to get access to the Component Manager or better they simply + // need to declare their components requirements using the @Inject annotation of the xwiki + // component manager together with a private class member, for automatic injection by the CM on init. + servletContextEvent.getServletContext() + .setAttribute(org.xwiki.component.manager.ComponentManager.class.getName(), this.componentManager); + + // Use a Component Event Manager that stacks Component instance creation events till we tell it to flush them. + // The reason is that the Observation Manager used to send the events but we need the Application Context to + // be set up before we start sending events since there can be Observation Listener components that require + // the Application Context (this is the case for example for the Office Importer Lifecycle Listener). + StackingComponentEventManager eventManager = new StackingComponentEventManager(); + this.componentManager.setComponentEventManager(eventManager); + + // Initialize the Environment + try { + ServletEnvironment servletEnvironment = this.componentManager.getInstance(Environment.class); + servletEnvironment.setServletContext(servletContextEvent.getServletContext()); + } catch (ComponentLookupException e) { + throw new RuntimeException("Failed to initialize the Servlet Environment", e); + } + + // Initializes the Application Context. + // Even though the notion of ApplicationContext has been deprecated in favor of the notion of Environment we + // still keep this initialization for backward-compatibility. + // TODO: Add an Observation Even that we send when the Environment is initialized so that we can move the code + // below in an Event Listener and move it to the legacy module. + try { + ServletContainerInitializer containerInitializer = + this.componentManager.getInstance(ServletContainerInitializer.class); + containerInitializer + .initializeApplicationContext(JakartaServletBridge.toJavax(servletContextEvent.getServletContext())); + } catch (ComponentLookupException e) { + throw new RuntimeException("Failed to initialize the Application Context", e); + } + + // Send an Observation event to signal the XWiki application is started. This allows components who need to do + // something on startup to do it. + ObservationManager observationManager; + try { + observationManager = this.componentManager.getInstance(ObservationManager.class); + } catch (ComponentLookupException e) { + throw new RuntimeException("Failed to find the Observation Manager component", e); + } + + // Make sure installed extensions are initialized before sending ApplicationStartedEvent + try { + this.componentManager.getInstance(ExtensionInitializer.class); + } catch (ComponentLookupException e) { + throw new RuntimeException("Failed to initialize installed extensions", e); + } + + // Register the HttpSessionManager as a listener. + try { + HttpSessionManager httpSessionManager = this.componentManager.getInstance(HttpSessionManager.class); + servletContextEvent.getServletContext().addListener(httpSessionManager); + } catch (ComponentLookupException e) { + throw new RuntimeException("Failed to initialize HttpSessionManager", e); + } + + // Now that the Application Context is set up and the component are registered, send the Component instance + // creation events we had stacked up. + eventManager.setObservationManager(observationManager); + eventManager.shouldStack(false); + eventManager.flushEvents(); + + // Indicate to the various components that XWiki is ready + observationManager.notify(new ApplicationStartedEvent(), this); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) + { + SHUTDOWN_LOGGER.debug("Stopping XWiki..."); + + // It's possible that the Component Manager failed to initialize some of the required components. + if (this.componentManager != null) { + // Send an Observation event to signal the XWiki application is stopped. This allows components who need + // to do something on stop to do it. + try { + ObservationManager observationManager = this.componentManager.getInstance(ObservationManager.class); + observationManager.notify(new ApplicationStoppedEvent(), this); + } catch (ComponentLookupException e) { + // Nothing to do here. + // TODO: Log a warning + } + + // Even though the notion of ApplicationContext has been deprecated in favor of the notion of Environment we + // still keep this destruction for backward-compatibility. + // TODO: Add an Observation Even that we send when the Environment is destroyed so that we can move the code + // below in an Event Listener and move it to the legacy module. + try { + ApplicationContextListenerManager applicationContextListenerManager = + this.componentManager.getInstance(ApplicationContextListenerManager.class); + Container container = this.componentManager.getInstance(Container.class); + applicationContextListenerManager.destroyApplicationContext(container.getApplicationContext()); + } catch (ComponentLookupException ex) { + // Nothing to do here. + // TODO: Log a warning + } + + // Make sure to dispose all components before leaving + this.componentManager.dispose(); + } + + SHUTDOWN_LOGGER.debug("XWiki has been stopped!"); + } +} diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextListener.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextListener.java index 7054d0fa2af8..319b837b78d0 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextListener.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/XWikiServletContextListener.java @@ -22,155 +22,30 @@ import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.xwiki.component.embed.EmbeddableComponentManager; -import org.xwiki.component.internal.StackingComponentEventManager; -import org.xwiki.component.manager.ComponentLookupException; -import org.xwiki.container.ApplicationContextListenerManager; -import org.xwiki.container.Container; -import org.xwiki.container.servlet.internal.HttpSessionManager; -import org.xwiki.environment.Environment; -import org.xwiki.environment.internal.ServletEnvironment; -import org.xwiki.extension.handler.ExtensionInitializer; -import org.xwiki.observation.ObservationManager; -import org.xwiki.observation.event.ApplicationStartedEvent; -import org.xwiki.observation.event.ApplicationStoppedEvent; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; /** * Implementation of the {@link ServletContextListener}. Initializes component manager and application context. * * @version $Id$ + * @deprecated use {@link XWikiServletContextInitializer} instead */ +@Deprecated(since = "42.0.0") public class XWikiServletContextListener implements ServletContextListener { - /** - * Logger to use to log shutdown information (opposite of initialization). - */ - private static final Logger SHUTDOWN_LOGGER = LoggerFactory.getLogger("org.xwiki.shutdown"); - - /** The component manager used to lookup other components. */ - private EmbeddableComponentManager componentManager; + private final XWikiServletContextInitializer jakarta = new XWikiServletContextInitializer(); @Override - public void contextInitialized(ServletContextEvent servletContextEvent) + public void contextInitialized(ServletContextEvent sce) { - // Initializes the Embeddable Component Manager - EmbeddableComponentManager ecm = new EmbeddableComponentManager(); - - // Initialize all the components. Note that this can fail with a Runtime Exception. This is done voluntarily so - // that the XWiki webapp will not be available if one component fails to load. It's better to fail-fast. - ecm.initialize(this.getClass().getClassLoader()); - this.componentManager = ecm; - - // This is a temporary bridge to allow non XWiki components to lookup XWiki components. - // We're putting the XWiki Component Manager instance in the Servlet Context so that it's - // available in the XWikiAction class which in turn puts it into the XWikiContext instance. - // Class that need to lookup then just need to get it from the XWikiContext instance. - // This is of course not necessary for XWiki components since they just need to implement - // the Composable interface to get access to the Component Manager or better they simply - // need to declare their components requirements using the @Inject annotation of the xwiki - // component manager together with a private class member, for automatic injection by the CM on init. - servletContextEvent.getServletContext() - .setAttribute(org.xwiki.component.manager.ComponentManager.class.getName(), this.componentManager); - - // Use a Component Event Manager that stacks Component instance creation events till we tell it to flush them. - // The reason is that the Observation Manager used to send the events but we need the Application Context to - // be set up before we start sending events since there can be Observation Listener components that require - // the Application Context (this is the case for example for the Office Importer Lifecycle Listener). - StackingComponentEventManager eventManager = new StackingComponentEventManager(); - this.componentManager.setComponentEventManager(eventManager); - - // Initialize the Environment - try { - ServletEnvironment servletEnvironment = this.componentManager.getInstance(Environment.class); - servletEnvironment.setServletContext(servletContextEvent.getServletContext()); - } catch (ComponentLookupException e) { - throw new RuntimeException("Failed to initialize the Servlet Environment", e); - } - - // Initializes the Application Context. - // Even though the notion of ApplicationContext has been deprecated in favor of the notion of Environment we - // still keep this initialization for backward-compatibility. - // TODO: Add an Observation Even that we send when the Environment is initialized so that we can move the code - // below in an Event Listener and move it to the legacy module. - try { - ServletContainerInitializer containerInitializer = - this.componentManager.getInstance(ServletContainerInitializer.class); - containerInitializer.initializeApplicationContext(servletContextEvent.getServletContext()); - } catch (ComponentLookupException e) { - throw new RuntimeException("Failed to initialize the Application Context", e); - } - - // Send an Observation event to signal the XWiki application is started. This allows components who need to do - // something on startup to do it. - ObservationManager observationManager; - try { - observationManager = this.componentManager.getInstance(ObservationManager.class); - } catch (ComponentLookupException e) { - throw new RuntimeException("Failed to find the Observation Manager component", e); - } - - // Make sure installed extensions are initialized before sending ApplicationStartedEvent - try { - this.componentManager.getInstance(ExtensionInitializer.class); - } catch (ComponentLookupException e) { - throw new RuntimeException("Failed to initialize installed extensions", e); - } - - // Register the HttpSessionManager as a listener. - try { - HttpSessionManager httpSessionManager = this.componentManager.getInstance(HttpSessionManager.class); - servletContextEvent.getServletContext().addListener(httpSessionManager); - } catch (ComponentLookupException e) { - throw new RuntimeException("Failed to initialize HttpSessionManager", e); - } - - // Now that the Application Context is set up and the component are registered, send the Component instance - // creation events we had stacked up. - eventManager.setObservationManager(observationManager); - eventManager.shouldStack(false); - eventManager.flushEvents(); - - // Indicate to the various components that XWiki is ready - observationManager.notify(new ApplicationStartedEvent(), this); + this.jakarta.contextInitialized( + new jakarta.servlet.ServletContextEvent(JakartaServletBridge.toJakarta(sce.getServletContext()))); } @Override public void contextDestroyed(ServletContextEvent sce) { - SHUTDOWN_LOGGER.debug("Stopping XWiki..."); - - // It's possible that the Component Manager failed to initialize some of the required components. - if (this.componentManager != null) { - // Send an Observation event to signal the XWiki application is stopped. This allows components who need - // to do something on stop to do it. - try { - ObservationManager observationManager = this.componentManager.getInstance(ObservationManager.class); - observationManager.notify(new ApplicationStoppedEvent(), this); - } catch (ComponentLookupException e) { - // Nothing to do here. - // TODO: Log a warning - } - - // Even though the notion of ApplicationContext has been deprecated in favor of the notion of Environment we - // still keep this destruction for backward-compatibility. - // TODO: Add an Observation Even that we send when the Environment is destroyed so that we can move the code - // below in an Event Listener and move it to the legacy module. - try { - ApplicationContextListenerManager applicationContextListenerManager = - this.componentManager.getInstance(ApplicationContextListenerManager.class); - Container container = this.componentManager.getInstance(Container.class); - applicationContextListenerManager.destroyApplicationContext(container.getApplicationContext()); - } catch (ComponentLookupException ex) { - // Nothing to do here. - // TODO: Log a warning - } - - // Make sure to dispose all components before leaving - this.componentManager.dispose(); - } - - SHUTDOWN_LOGGER.debug("XWiki has been stopped!"); + this.jakarta.contextDestroyed( + new jakarta.servlet.ServletContextEvent(JakartaServletBridge.toJakarta(sce.getServletContext()))); } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/SavedRequestManager.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/SavedRequestManager.java index fe7206aa864c..0f1fc8806b18 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/SavedRequestManager.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/SavedRequestManager.java @@ -23,11 +23,13 @@ import java.util.HashMap; import java.util.Map; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; /** * Allows to save a request and restore it later from the stored request identifier (SRID). @@ -64,20 +66,33 @@ public static class SavedRequest implements Serializable * Constructor that copies the needed information from a request. * * @param request the request that needs to be saved + * @deprecated use {@link #SavedRequest(HttpServletRequest)}) instead */ - @SuppressWarnings("unchecked") + @Deprecated(since = "42.0.0") + public SavedRequest(javax.servlet.http.HttpServletRequest request) + { + this(JakartaServletBridge.toJakarta(request)); + } + + /** + * Constructor that copies the needed information from a request. + * + * @param request the request that needs to be saved + * @since 42.0.0 + */ + @Unstable public SavedRequest(HttpServletRequest request) { - this.parameters = new HashMap(request.getParameterMap()); + this.parameters = new HashMap<>(request.getParameterMap()); this.requestUrl = request.getRequestURL().toString(); } /** - * Gets the value for a parameter, just like {@link javax.servlet.ServletRequest#getParameter(String)}. + * Gets the value for a parameter, just like {@link jakarta.servlet.ServletRequest#getParameter(String)}. * * @param name the name of the parameter * @return The first value for this parameter, or null if no value was sent for this parameter. - * @see javax.servlet.ServletRequest#getParameter(String) + * @see jakarta.servlet.ServletRequest#getParameter(String) * @see #getParameterValues(String) */ public String getParameter(String name) @@ -91,11 +106,11 @@ public String getParameter(String name) /** * Gets all the values stored for a parameter, just like - * {@link javax.servlet.ServletRequest#getParameterValues(String)}. + * {@link jakarta.servlet.ServletRequest#getParameterValues(String)}. * * @param name the name of the parameter * @return All the values for this parameter, or null if no value was sent for this parameter. - * @see javax.servlet.ServletRequest#getParameterValues(String) + * @see jakarta.servlet.ServletRequest#getParameterValues(String) * @see #getParameter(String) */ public String[] getParameterValues(String name) @@ -104,10 +119,10 @@ public String[] getParameterValues(String name) } /** - * Gets all the stored parameters, just like {@link javax.servlet.ServletRequest#getParameterMap()}. + * Gets all the stored parameters, just like {@link jakarta.servlet.ServletRequest#getParameterMap()}. * * @return A map with all the stored parameters. - * @see javax.servlet.ServletRequest#getParameterMap() + * @see jakarta.servlet.ServletRequest#getParameterMap() */ public Map getParameterMap() { @@ -156,7 +171,24 @@ public static String getSavedRequestKey() * * @param request the request to save * @return the identifier of the saved request + * @deprecated use {@link #saveRequest(HttpServletRequest)} instead */ + @Deprecated(since = "42.0.0") + public static String saveRequest(javax.servlet.http.HttpServletRequest request) + { + return saveRequest(JakartaServletBridge.toJakarta(request)); + } + + /** + * Saves the data from a request and stores it in the current session. This method is not thread safe, and does not + * guarantee that saved requests are not overwritten, but given that this should only happen sparingly, and that + * each client uses his own session to save this kind of information, this is not a real issue. + * + * @param request the request to save + * @return the identifier of the saved request + * @since 42.0.0 + */ + @Unstable @SuppressWarnings("unchecked") public static String saveRequest(HttpServletRequest request) { @@ -166,7 +198,7 @@ public static String saveRequest(HttpServletRequest request) Map savedRequests = (Map) session.getAttribute(getSavedRequestKey()); if (savedRequests == null) { - savedRequests = new HashMap(); + savedRequests = new HashMap<>(); session.setAttribute(getSavedRequestKey(), savedRequests); } // Save the request data @@ -190,7 +222,25 @@ public static String saveRequest(HttpServletRequest request) * @param request the current request * @return the original requested URL that triggered a detour, or null if there isn't any original * request information + * @deprecated use {@link #getOriginalUrl(HttpServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + public static String getOriginalUrl(javax.servlet.http.HttpServletRequest request) + { + return getOriginalUrl(JakartaServletBridge.toJakarta(request)); + } + + /** + * Retrieves the original URL requested before a detour. This method returns something different from + * null only when there's a srid parameter in the current request, indicating that there was + * another request which data was saved, related to the current request. + * + * @param request the current request + * @return the original requested URL that triggered a detour, or null if there isn't any original + * request information + * @since 42.0.0 */ + @Unstable @SuppressWarnings("unchecked") public static String getOriginalUrl(HttpServletRequest request) { diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SavedRequestRestorerFilter.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SavedRequestRestorerFilter.java index 497f09f8e284..291d70f34314 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SavedRequestRestorerFilter.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SavedRequestRestorerFilter.java @@ -27,15 +27,15 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import javax.servlet.http.HttpSession; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import jakarta.servlet.http.HttpSession; import org.apache.commons.lang3.StringUtils; import org.xwiki.container.servlet.filters.SavedRequestManager; @@ -61,8 +61,12 @@ * safe as a session is, and it will not be available after the session is invalidated. Another consequence is that only * HTTP requests are saved. *

+ *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely + * different API from Java point of view. * * @version $Id$ + * @since 42.0.0 */ public class SavedRequestRestorerFilter implements Filter { @@ -156,7 +160,6 @@ public String[] getParameterValues(String name) * @return an immutable Map containing parameter names as keys and parameter values as map values * @see javax.servlet.ServletRequest#getParameterMap() */ - @SuppressWarnings("unchecked") @Override public Map getParameterMap() { @@ -191,13 +194,13 @@ public void init(FilterConfig filterConfig) } @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, - ServletException + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { ServletRequest filteredRequest = request; // This filter works only for HTTP requests, because they are the only ones with a session. if (request instanceof HttpServletRequest - && !Boolean.valueOf((String) request.getAttribute(ATTRIBUTE_APPLIED))) { + && !Boolean.valueOf((String) request.getAttribute(ATTRIBUTE_APPLIED))) { // Get the saved request, if any (returns null if not applicable) SavedRequest savedRequest = getSavedRequest((HttpServletRequest) request); // Merge the new and the saved request diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetCharacterEncodingFilter.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetCharacterEncodingFilter.java index 650288c51cc8..3f78ef036bf4 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetCharacterEncodingFilter.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetCharacterEncodingFilter.java @@ -21,12 +21,12 @@ import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; /** *

@@ -51,9 +51,13 @@ * characteristics of the incoming request (such as the values of the Accept-Language * and User-Agent headers, or a value stashed in the current user's session. *

+ *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely different API + * from Java point of view. * * @author Craig McClanahan * @version $Id$ + * @since 42.0.0 */ public class SetCharacterEncodingFilter implements Filter { diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetHTTPHeaderFilter.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetHTTPHeaderFilter.java index a306a2b297e1..f7ae02c175a6 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetHTTPHeaderFilter.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/filters/internal/SetHTTPHeaderFilter.java @@ -21,19 +21,22 @@ import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; /** * Filter that set the desired header of the HTTP response to the desired value. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely + * different API from Java point of view. * * @version $Id$ - * @since 6.3M2 + * @since 42.0.0 */ public class SetHTTPHeaderFilter implements Filter { diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/CacheControlRequestInitializer.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/CacheControlRequestInitializer.java index 542c7a0429a3..9036a6ce85aa 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/CacheControlRequestInitializer.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/CacheControlRequestInitializer.java @@ -47,8 +47,8 @@ public class CacheControlRequestInitializer implements RequestInitializer public void initialize(Request request) throws RequestInitializerException { // Indicate if the request explicitly disable getting resources from the cache - if (request instanceof ServletRequest - && !HttpServletUtils.isCacheReadAllowed(((ServletRequest) request).getHttpServletRequest())) { + if (request instanceof ServletRequest servletRequest + && !HttpServletUtils.isCacheReadAllowed(servletRequest.getJakartaHttpServletRequest())) { this.cacheControl.setCacheReadAllowed(false); } } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/DefaultServletContainerInitializer.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/DefaultServletContainerInitializer.java index 6b710c25d00b..b9f404332e83 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/DefaultServletContainerInitializer.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/DefaultServletContainerInitializer.java @@ -22,8 +22,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.xwiki.component.annotation.Component; import org.xwiki.component.manager.ComponentManager; @@ -41,17 +39,13 @@ import org.xwiki.context.ExecutionContext; import org.xwiki.context.ExecutionContextManager; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + @Component @Singleton public class DefaultServletContainerInitializer implements ServletContainerInitializer { - // Implementation note: It's important that we don't use @Inject annotations here - // for RequestInitializerManager and ExecutionContextManager since we can have - // RequestInitializer and ExecutionContextInitializer components which try to access - // the Application Context in their initialize() method and we need it to be available - // (i.e. initializeApplicationContext() needs to have been called) before they are - // looked up (and thus initialized). - @Inject private ApplicationContextListenerManager applicationContextListenerManager; @@ -64,6 +58,40 @@ public class DefaultServletContainerInitializer implements ServletContainerIniti @Inject private ComponentManager componentManager; + @Override + public void initializeRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletContainerException + { + // 1) Set the request and the response in the Container. From this point forward request initializers can use + // the Container object to get any data they want from the Request. + this.container.setRequest(new ServletRequest(request)); + if (response != null) { + this.container.setResponse(new ServletResponse(response)); + } + + // 2) Create an empty Execution context so that the Container initializers can put things in the + // execution context when they execute. + this.execution.setContext(new ExecutionContext()); + + // 3) Call the request initializers to populate the Request further. + try { + RequestInitializerManager manager = this.componentManager.getInstance(RequestInitializerManager.class); + manager.initializeRequest(this.container.getRequest()); + } catch (Exception e) { + throw new ServletContainerException("Failed to initialize request", e); + } + + // 4) Call Execution Context initializers to perform further Execution Context initializations + try { + ExecutionContextManager manager = this.componentManager.getInstance(ExecutionContextManager.class); + manager.initialize(this.execution.getContext()); + } catch (Exception e) { + throw new ServletContainerException("Failed to initialize Execution Context", e); + } + } + + // Deprecated + /** * @deprecated use the notion of Environment instead */ @@ -77,7 +105,8 @@ public void initializeApplicationContext(ServletContext servletContext) } @Override - public void initializeRequest(HttpServletRequest httpServletRequest, Object xwikiContext) + @Deprecated(since = "42.0.0") + public void initializeRequest(javax.servlet.http.HttpServletRequest httpServletRequest, Object xwikiContext) throws ServletContainerException { // 1) Create an empty request. From this point forward request initializers can use the @@ -118,19 +147,23 @@ public void initializeRequest(HttpServletRequest httpServletRequest, Object xwik } @Override - public void initializeRequest(HttpServletRequest httpServletRequest) throws ServletContainerException + @Deprecated(since = "42.0.0") + public void initializeRequest(javax.servlet.http.HttpServletRequest httpServletRequest) + throws ServletContainerException { initializeRequest(httpServletRequest, null); } @Override - public void initializeResponse(HttpServletResponse httpServletResponse) + @Deprecated(since = "42.0.0") + public void initializeResponse(javax.servlet.http.HttpServletResponse httpServletResponse) { this.container.setResponse(new ServletResponse(httpServletResponse)); } @Override - public void initializeSession(HttpServletRequest httpServletRequest) + @Deprecated(since = "42.0.0") + public void initializeSession(javax.servlet.http.HttpServletRequest httpServletRequest) { this.container.setSession(new ServletSession(httpServletRequest)); } diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/HttpSessionManager.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/HttpSessionManager.java index c60ed9b24550..0e52f5c4a38e 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/HttpSessionManager.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/main/java/org/xwiki/container/servlet/internal/HttpSessionManager.java @@ -23,11 +23,11 @@ import java.util.List; import java.util.concurrent.ConcurrentLinkedQueue; -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionEvent; -import javax.servlet.http.HttpSessionListener; +import jakarta.inject.Inject; +import jakarta.inject.Singleton; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionListener; import org.xwiki.component.annotation.Component; import org.xwiki.component.manager.ComponentLifecycleException; @@ -39,13 +39,15 @@ import org.xwiki.observation.ObservationManager; /** - * Manager in charge of keeping track of the {@link HttpSession}. - * One of the role of this component is to properly call {@link HttpSession#invalidate()} on all sessions before - * disposal of the component: this ensures that all listeners relying on the session disposal can be executed. + * Manager in charge of keeping track of the {@link HttpSession}. One of the role of this component is to properly call + * {@link HttpSession#invalidate()} on all sessions before disposal of the component: this ensures that all listeners + * relying on the session disposal can be executed. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implements a completely + * different API from Java point of view. * * @version $Id$ - * @since 14.5 - * @since 14.4.1 + * @since 42.0.0 */ @Component(roles = HttpSessionManager.class) @Singleton diff --git a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/test/java/org/xwiki/container/servlet/internal/HttpSessionManagerTest.java b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/test/java/org/xwiki/container/servlet/internal/HttpSessionManagerTest.java index 02ac3b975375..bcbd3e2cc5ff 100644 --- a/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/test/java/org/xwiki/container/servlet/internal/HttpSessionManagerTest.java +++ b/xwiki-platform-core/xwiki-platform-container/xwiki-platform-container-servlet/src/test/java/org/xwiki/container/servlet/internal/HttpSessionManagerTest.java @@ -21,8 +21,8 @@ import java.util.List; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpSessionEvent; import org.junit.jupiter.api.Test; import org.xwiki.component.manager.ComponentLifecycleException; diff --git a/xwiki-platform-core/xwiki-platform-crypto/xwiki-platform-crypto-store/xwiki-platform-crypto-store-wiki/pom.xml b/xwiki-platform-core/xwiki-platform-crypto/xwiki-platform-crypto-store/xwiki-platform-crypto-store-wiki/pom.xml index 22e4140b2070..e525d4e6747a 100644 --- a/xwiki-platform-core/xwiki-platform-crypto/xwiki-platform-crypto-store/xwiki-platform-crypto-store-wiki/pom.xml +++ b/xwiki-platform-core/xwiki-platform-crypto/xwiki-platform-crypto-store/xwiki-platform-crypto-store-wiki/pom.xml @@ -91,8 +91,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-csrf/pom.xml b/xwiki-platform-core/xwiki-platform-csrf/pom.xml index 3f82e1a8074f..80f056108b35 100644 --- a/xwiki-platform-core/xwiki-platform-csrf/pom.xml +++ b/xwiki-platform-core/xwiki-platform-csrf/pom.xml @@ -66,8 +66,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api commons-codec diff --git a/xwiki-platform-core/xwiki-platform-csrf/src/main/java/org/xwiki/csrf/internal/DefaultCSRFToken.java b/xwiki-platform-core/xwiki-platform-csrf/src/main/java/org/xwiki/csrf/internal/DefaultCSRFToken.java index 14047ca6eab7..855e89220568 100644 --- a/xwiki-platform-core/xwiki-platform-csrf/src/main/java/org/xwiki/csrf/internal/DefaultCSRFToken.java +++ b/xwiki-platform-core/xwiki-platform-csrf/src/main/java/org/xwiki/csrf/internal/DefaultCSRFToken.java @@ -28,7 +28,6 @@ import javax.inject.Inject; import javax.inject.Singleton; -import javax.servlet.http.HttpServletRequest; import org.apache.commons.codec.binary.Base64; import org.slf4j.Logger; @@ -44,6 +43,8 @@ import org.xwiki.csrf.CSRFTokenConfiguration; import org.xwiki.model.reference.DocumentReference; +import jakarta.servlet.http.HttpServletRequest; + /** * Concrete implementation of the {@link CSRFToken} component. *

@@ -70,7 +71,7 @@ public class DefaultCSRFToken implements CSRFToken, Initializable private static final String RESUBMIT_TEMPLATE = "resubmit"; /** Token storage (one token per user). */ - private final ConcurrentMap tokens = new ConcurrentHashMap(); + private final ConcurrentMap tokens = new ConcurrentHashMap<>(); /** Token for guest user. */ private String guestToken; @@ -168,8 +169,9 @@ public boolean isTokenValid(String token) } String storedToken = getToken(); if (token == null || token.equals("") || !storedToken.equals(token)) { - this.logger.warn("CSRFToken: Secret token verification failed, token: \"" + token - + "\", stored token: \"" + storedToken + "\""); + this.logger.warn("CSRFToken: Secret token verification failed, token: \"{}\", stored token: \"{}\"", token, + storedToken); + return false; } return true; @@ -238,9 +240,10 @@ private String urlEncode(String str) private HttpServletRequest getRequest() { Request request = this.container.getRequest(); - if (request instanceof ServletRequest) { - return ((ServletRequest) request).getHttpServletRequest(); + if (request instanceof ServletRequest servletRequest) { + return servletRequest.getJakartaHttpServletRequest(); } + throw new RuntimeException("Not supported request type"); } diff --git a/xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/pom.xml b/xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/pom.xml index bcb71dc9c183..c5e592020897 100644 --- a/xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/pom.xml +++ b/xwiki-platform-core/xwiki-platform-dashboard/xwiki-platform-dashboard-macro/pom.xml @@ -81,11 +81,6 @@ ${rendering.version} test - - javax.servlet - javax.servlet-api - test - org.mortbay.jasper apache-el diff --git a/xwiki-platform-core/xwiki-platform-diff/xwiki-platform-diff-xml/pom.xml b/xwiki-platform-core/xwiki-platform-diff/xwiki-platform-diff-xml/pom.xml index 6b1c1b9196b8..cb109a83895f 100644 --- a/xwiki-platform-core/xwiki-platform-diff/xwiki-platform-diff-xml/pom.xml +++ b/xwiki-platform-core/xwiki-platform-diff/xwiki-platform-diff-xml/pom.xml @@ -54,8 +54,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.commons diff --git a/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/pom.xml b/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/pom.xml index 2588afc623eb..a6810b545346 100644 --- a/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/pom.xml +++ b/xwiki-platform-core/xwiki-platform-eventstream/xwiki-platform-eventstream-stores/xwiki-platform-eventstream-store-solr/pom.xml @@ -98,11 +98,6 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-search-solr-api diff --git a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/pom.xml b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/pom.xml index 8ed8e6eadb9c..d2c1e77b13b5 100644 --- a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/pom.xml @@ -78,8 +78,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/main/java/org/xwiki/export/pdf/browser/BrowserTab.java b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/main/java/org/xwiki/export/pdf/browser/BrowserTab.java index 434a0cd54f54..4ace7285ff2e 100644 --- a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/main/java/org/xwiki/export/pdf/browser/BrowserTab.java +++ b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/main/java/org/xwiki/export/pdf/browser/BrowserTab.java @@ -23,7 +23,10 @@ import java.io.InputStream; import java.net.URL; -import javax.servlet.http.Cookie; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; + +import jakarta.servlet.http.Cookie; /** * Represents a web browser tab. @@ -43,8 +46,42 @@ public interface BrowserTab extends AutoCloseable * @return {@code true} if the navigation was successful, {@code false} otherwise * @throws IOException if navigating to the specified web page fails * @since 14.9 + * @deprecated use {@link #navigate(URL, Cookie[], boolean, int)} instead + */ + @Deprecated(since = "42.0.0") + boolean navigate(URL url, javax.servlet.http.Cookie[] cookies, boolean wait, int timeout) throws IOException; + + /** + * Navigates to the specified web page, optionally waiting for it to be ready (fully loaded). + * + * @param url the URL of the web page we are going to navigate to + * @param cookies the cookies to use when loading the specified web page + * @param wait {@code true} to wait for the page to be ready, {@code false} otherwise + * @param timeout the number of seconds to wait for the web page to be ready before timing out + * @return {@code true} if the navigation was successful, {@code false} otherwise + * @throws IOException if navigating to the specified web page fails + * @since 42.0.0 */ - boolean navigate(URL url, Cookie[] cookies, boolean wait, int timeout) throws IOException; + @Unstable + default boolean navigate(URL url, Cookie[] cookies, boolean wait, int timeout) throws IOException + { + return navigate(url, JakartaServletBridge.toJavax(cookies), wait, timeout); + } + + /** + * Navigates to the specified web page, optionally waiting for it to be ready (fully loaded). + * + * @param url the URL of the web page we are going to navigate to + * @param cookies the cookies to use when loading the specified web page + * @param wait {@code true} to wait for the page to be ready, {@code false} otherwise + * @return {@code true} if the navigation was successful, {@code false} otherwise + * @throws IOException if navigating to the specified web page fails + */ + @Deprecated(since = "42.0.0") + default boolean navigate(URL url, javax.servlet.http.Cookie[] cookies, boolean wait) throws IOException + { + return navigate(url, cookies, wait, 60); + } /** * Navigates to the specified web page, optionally waiting for it to be ready (fully loaded). @@ -54,7 +91,9 @@ public interface BrowserTab extends AutoCloseable * @param wait {@code true} to wait for the page to be ready, {@code false} otherwise * @return {@code true} if the navigation was successful, {@code false} otherwise * @throws IOException if navigating to the specified web page fails + * @since 42.0.0 */ + @Unstable default boolean navigate(URL url, Cookie[] cookies, boolean wait) throws IOException { return navigate(url, cookies, wait, 60); @@ -70,7 +109,7 @@ default boolean navigate(URL url, Cookie[] cookies, boolean wait) throws IOExcep */ default boolean navigate(URL url, boolean wait) throws IOException { - return navigate(url, null, wait); + return navigate(url, (Cookie[]) null, wait); } /** diff --git a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/test/java/org/xwiki/export/pdf/browser/BrowserPDFPrinterTest.java b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/test/java/org/xwiki/export/pdf/browser/BrowserPDFPrinterTest.java index 342560b4aeb5..50db1700c181 100644 --- a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/test/java/org/xwiki/export/pdf/browser/BrowserPDFPrinterTest.java +++ b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-api/src/test/java/org/xwiki/export/pdf/browser/BrowserPDFPrinterTest.java @@ -232,7 +232,7 @@ void isAvailable() void navigate() throws Exception { URL url = new URL("http://xwiki.org"); - when(this.browserTab.navigate(url, null, false, 60)).thenReturn(true); + when(this.browserTab.navigate(url, (jakarta.servlet.http.Cookie[]) null, false, 60)).thenReturn(true); assertTrue(this.browserTab.navigate(url)); } } diff --git a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/pom.xml b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/pom.xml index 5f9510e2cc7d..ccdbc424cde0 100644 --- a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/pom.xml @@ -65,8 +65,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/main/java/org/xwiki/export/pdf/internal/chrome/ChromeTab.java b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/main/java/org/xwiki/export/pdf/internal/chrome/ChromeTab.java index 671fdcbfb94c..9c4c61501cce 100644 --- a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/main/java/org/xwiki/export/pdf/internal/chrome/ChromeTab.java +++ b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/main/java/org/xwiki/export/pdf/internal/chrome/ChromeTab.java @@ -29,13 +29,12 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.servlet.http.Cookie; - import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xwiki.export.pdf.PDFExportConfiguration; import org.xwiki.export.pdf.browser.BrowserTab; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; import com.github.kklisura.cdt.protocol.commands.Network; import com.github.kklisura.cdt.protocol.commands.Page; @@ -50,6 +49,8 @@ import com.github.kklisura.cdt.protocol.types.target.TargetInfo; import com.github.kklisura.cdt.services.ChromeDevToolsService; +import jakarta.servlet.http.Cookie; + /** * Represents a Chrome web browser tab. * @@ -101,6 +102,12 @@ public void close() this.browserDevToolsService.getTarget().disposeBrowserContext(browserContextId); } + @Override + public boolean navigate(URL url, javax.servlet.http.Cookie[] cookies, boolean wait, int timeout) throws IOException + { + return navigate(url, JakartaServletBridge.toJakarta(cookies), wait, timeout); + } + @Override public boolean navigate(URL url, Cookie[] cookies, boolean wait, int timeout) throws IOException { diff --git a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/test/java/org/xwiki/export/pdf/internal/chrome/ChromeTabTest.java b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/test/java/org/xwiki/export/pdf/internal/chrome/ChromeTabTest.java index 17753f049b71..e80e81aeaefd 100644 --- a/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/test/java/org/xwiki/export/pdf/internal/chrome/ChromeTabTest.java +++ b/xwiki-platform-core/xwiki-platform-export/xwiki-platform-export-pdf/xwiki-platform-export-pdf-default/src/test/java/org/xwiki/export/pdf/internal/chrome/ChromeTabTest.java @@ -25,7 +25,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; -import javax.servlet.http.Cookie; +import jakarta.servlet.http.Cookie; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.BeforeEach; @@ -168,7 +168,7 @@ void navigateWithError() throws Exception when(this.page.navigate(url.toString())).thenReturn(navigate); when(navigate.getErrorText()).thenReturn("Failed to navigate!"); - assertFalse(this.chromeTab.navigate(url, null, false)); + assertFalse(this.chromeTab.navigate(url, (Cookie[]) null, false)); } @Test @@ -192,7 +192,7 @@ void navigateWithWait() throws Exception when(evaluate.getResult()).thenReturn(result); when(result.getValue()).thenReturn("Page ready."); - assertTrue(this.chromeTab.navigate(url, null, true, 25)); + assertTrue(this.chromeTab.navigate(url, (Cookie[]) null, true, 25)); verify(this.runtime).enable(); } @@ -222,7 +222,7 @@ void navigateWithWaitAndException() throws Exception when(exception.getValue()).thenReturn("'xwiki-page-ready' module not found"); try { - this.chromeTab.navigate(url, null, true); + this.chromeTab.navigate(url, (Cookie[]) null, true); fail("Navigation should have thrown an exception."); } catch (IOException e) { assertEquals("Failed to wait for page to be ready. Root cause: 'xwiki-page-ready' module not found", diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-distribution/pom.xml b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-distribution/pom.xml index d2b9f9cd2c27..c070ab7c427c 100644 --- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-distribution/pom.xml +++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-distribution/pom.xml @@ -66,8 +66,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-handlers/xwiki-platform-extension-handler-xar/pom.xml b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-handlers/xwiki-platform-extension-handler-xar/pom.xml index 402424959353..e33577acdedc 100644 --- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-handlers/xwiki-platform-extension-handler-xar/pom.xml +++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-handlers/xwiki-platform-extension-handler-xar/pom.xml @@ -132,11 +132,6 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-security-authorization-bridge diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/pom.xml b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/pom.xml index 7d233917e7dd..cbc8ee456af1 100644 --- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/pom.xml +++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-index/pom.xml @@ -71,11 +71,6 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-search-solr-api diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-script/pom.xml b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-script/pom.xml index 31eb47712980..bf4e6419be6d 100644 --- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-script/pom.xml +++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-script/pom.xml @@ -78,11 +78,6 @@ pom test - - javax.servlet - javax.servlet-api - test - diff --git a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-api/pom.xml b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-api/pom.xml index c11aca7c3623..e9e5ecf00e16 100644 --- a/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-extension/xwiki-platform-extension-security/xwiki-platform-extension-security-api/pom.xml @@ -62,8 +62,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-feed/xwiki-platform-feed-api/pom.xml b/xwiki-platform-core/xwiki-platform-feed/xwiki-platform-feed-api/pom.xml index 96809d706fc9..15da5cdc6ee3 100644 --- a/xwiki-platform-core/xwiki-platform-feed/xwiki-platform-feed-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-feed/xwiki-platform-feed-api/pom.xml @@ -60,10 +60,7 @@ org.jdom jdom - - javax.servlet - javax.servlet-api - + org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-default/pom.xml b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-default/pom.xml index 987e7a9826d6..5f8cfbde4b5d 100644 --- a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-default/pom.xml @@ -72,8 +72,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-macro/pom.xml b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-macro/pom.xml index e70e42d9b979..f5ec937a200d 100644 --- a/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-macro/pom.xml +++ b/xwiki-platform-core/xwiki-platform-icon/xwiki-platform-icon-macro/pom.xml @@ -87,8 +87,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-processing/xwiki-platform-image-processing-plugin/pom.xml b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-processing/xwiki-platform-image-processing-plugin/pom.xml index 687b78fda347..647c166fa9a7 100644 --- a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-processing/xwiki-platform-image-processing-plugin/pom.xml +++ b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-processing/xwiki-platform-image-processing-plugin/pom.xml @@ -47,11 +47,6 @@ xwiki-platform-oldcore ${project.version} - - javax.servlet - javax.servlet-api - compile - diff --git a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-api/pom.xml b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-api/pom.xml index 3e0b2d5e4d35..fe42695bbd56 100644 --- a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-api/pom.xml @@ -56,8 +56,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml index 191e32a27c5a..da503171f037 100644 --- a/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml +++ b/xwiki-platform-core/xwiki-platform-image/xwiki-platform-image-style/xwiki-platform-image-style-rest/pom.xml @@ -75,8 +75,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-default/pom.xml b/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-default/pom.xml index d0505f903430..b59b7aee42f2 100644 --- a/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-default/pom.xml @@ -60,8 +60,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-api/pom.xml b/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-api/pom.xml index 0cdd6d99ff81..23ef3d1e5543 100644 --- a/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-api/pom.xml @@ -88,8 +88,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-job/xwiki-platform-job-handler/pom.xml b/xwiki-platform-core/xwiki-platform-job/xwiki-platform-job-handler/pom.xml index afc5f2545844..29d9a9098946 100644 --- a/xwiki-platform-core/xwiki-platform-job/xwiki-platform-job-handler/pom.xml +++ b/xwiki-platform-core/xwiki-platform-job/xwiki-platform-job-handler/pom.xml @@ -76,8 +76,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-api/pom.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-api/pom.xml index 161629afa6b4..b6be659c4923 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-events-hibernate/xwiki-platform-legacy-events-hibernate-api/pom.xml @@ -68,8 +68,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-mail/xwiki-platform-legacy-mail-send/xwiki-platform-legacy-mail-send-storage/pom.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-mail/xwiki-platform-legacy-mail-send/xwiki-platform-legacy-mail-send-storage/pom.xml index 974f2fe7c662..20f8385457e2 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-mail/xwiki-platform-legacy-mail-send/xwiki-platform-legacy-mail-send-storage/pom.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-mail/xwiki-platform-legacy-mail-send/xwiki-platform-legacy-mail-send-storage/pom.xml @@ -62,8 +62,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-messagestream/xwiki-platform-legacy-messagestream-api/pom.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-messagestream/xwiki-platform-legacy-messagestream-api/pom.xml index f9488409c13a..47dc3e44d31e 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-messagestream/xwiki-platform-legacy-messagestream-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-messagestream/xwiki-platform-legacy-messagestream-api/pom.xml @@ -84,8 +84,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-rendering/xwiki-platform-legacy-rendering-wikimacro/xwiki-platform-legacy-rendering-wikimacro-store/pom.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-rendering/xwiki-platform-legacy-rendering-wikimacro/xwiki-platform-legacy-rendering-wikimacro-store/pom.xml index cb4211be1874..964816e7c096 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-rendering/xwiki-platform-legacy-rendering-wikimacro/xwiki-platform-legacy-rendering-wikimacro-store/pom.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-rendering/xwiki-platform-legacy-rendering-wikimacro/xwiki-platform-legacy-rendering-wikimacro-store/pom.xml @@ -61,6 +61,7 @@ org.aspectj aspectjrt + org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-security/xwiki-platform-legacy-security-authentication/xwiki-platform-legacy-security-authentication-api/pom.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-security/xwiki-platform-legacy-security-authentication/xwiki-platform-legacy-security-authentication-api/pom.xml index 172fe07bfc27..8908ac9d8192 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-security/xwiki-platform-legacy-security-authentication/xwiki-platform-legacy-security-authentication-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-security/xwiki-platform-legacy-security-authentication/xwiki-platform-legacy-security-authentication-api/pom.xml @@ -60,8 +60,8 @@ aspectjrt - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-url/pom.xml b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-url/pom.xml index 3244c3a388e9..5858011d66ca 100644 --- a/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-url/pom.xml +++ b/xwiki-platform-core/xwiki-platform-legacy/xwiki-platform-legacy-url/pom.xml @@ -48,8 +48,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-default/pom.xml b/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-default/pom.xml index 85fd6f9639d0..499adf95a8bd 100644 --- a/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-default/pom.xml @@ -63,8 +63,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api com.github.sommeri diff --git a/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-script/pom.xml b/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-script/pom.xml index 43442ce5202f..8fd0e503f6ca 100644 --- a/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-script/pom.xml +++ b/xwiki-platform-core/xwiki-platform-lesscss/xwiki-platform-lesscss-script/pom.xml @@ -68,8 +68,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/pom.xml b/xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/pom.xml index 25da0356e56c..ab9e49e350bd 100644 --- a/xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/pom.xml @@ -92,8 +92,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-linkchecker/xwiki-platform-linkchecker-api/pom.xml b/xwiki-platform-core/xwiki-platform-linkchecker/xwiki-platform-linkchecker-api/pom.xml index c381e7258be4..ad916a2b4489 100644 --- a/xwiki-platform-core/xwiki-platform-linkchecker/xwiki-platform-linkchecker-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-linkchecker/xwiki-platform-linkchecker-api/pom.xml @@ -61,8 +61,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-livetable/pom.xml b/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-livetable/pom.xml index 42433ec995b9..7532981e9fdf 100644 --- a/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-livetable/pom.xml +++ b/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-livetable/pom.xml @@ -54,8 +54,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-rest/pom.xml b/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-rest/pom.xml index 9d96dd52b615..9296f5006689 100644 --- a/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-rest/pom.xml +++ b/xwiki-platform-core/xwiki-platform-livedata/xwiki-platform-livedata-rest/pom.xml @@ -81,8 +81,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-livetable/xwiki-platform-livetable-ui/pom.xml b/xwiki-platform-core/xwiki-platform-livetable/xwiki-platform-livetable-ui/pom.xml index dc555c37f33f..a4026c9faf42 100644 --- a/xwiki-platform-core/xwiki-platform-livetable/xwiki-platform-livetable-ui/pom.xml +++ b/xwiki-platform-core/xwiki-platform-livetable/xwiki-platform-livetable-ui/pom.xml @@ -75,11 +75,6 @@ runtime - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-test-page diff --git a/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-legacy/pom.xml b/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-legacy/pom.xml index b09e8b2c5705..35dd6154d7d8 100644 --- a/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-legacy/pom.xml +++ b/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-legacy/pom.xml @@ -64,7 +64,6 @@ - org.xwiki.platform xwiki-platform-test-oldcore @@ -72,13 +71,6 @@ pom test - - - - org.jmock - jmock-legacy - test - diff --git a/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/pom.xml b/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/pom.xml index 6201b5f4064f..cdfc7f0f7437 100644 --- a/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/pom.xml +++ b/xwiki-platform-core/xwiki-platform-localization/xwiki-platform-localization-sources/xwiki-platform-localization-source-wiki/pom.xml @@ -68,7 +68,6 @@ - org.xwiki.platform xwiki-platform-test-oldcore @@ -76,13 +75,6 @@ pom test - - - - org.jmock - jmock-legacy - test - diff --git a/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-general/pom.xml b/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-general/pom.xml index ba29aa51ce83..c1ca0d9146a1 100644 --- a/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-general/pom.xml +++ b/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-general/pom.xml @@ -67,13 +67,6 @@ ${commons.version} test - - - javax.servlet - javax.servlet-api - test - - org.xwiki.platform xwiki-platform-oldcore diff --git a/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/pom.xml b/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/pom.xml index 126265a12fe0..3ddf9cf8d4eb 100644 --- a/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-default/pom.xml @@ -73,8 +73,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/pom.xml b/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/pom.xml index 2be302d9f412..f42815372a2e 100644 --- a/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/pom.xml +++ b/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/pom.xml @@ -70,8 +70,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-mailsender/pom.xml b/xwiki-platform-core/xwiki-platform-mailsender/pom.xml index 10394456e614..510769a0e9bb 100644 --- a/xwiki-platform-core/xwiki-platform-mailsender/pom.xml +++ b/xwiki-platform-core/xwiki-platform-mailsender/pom.xml @@ -44,6 +44,8 @@ xwiki-platform-oldcore ${project.version} + + com.icegreen greenmail-junit5 diff --git a/xwiki-platform-core/xwiki-platform-mentions/pom.xml b/xwiki-platform-core/xwiki-platform-mentions/pom.xml index 7214b66ad419..10855f054289 100644 --- a/xwiki-platform-core/xwiki-platform-mentions/pom.xml +++ b/xwiki-platform-core/xwiki-platform-mentions/pom.xml @@ -39,8 +39,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/pom.xml b/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/pom.xml index 8d82045922bf..0bb6bf593f7a 100644 --- a/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/pom.xml @@ -48,8 +48,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/src/main/resources/ApplicationResources_de.properties b/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/src/main/resources/ApplicationResources_de.properties deleted file mode 100644 index 0633301106ab..000000000000 --- a/xwiki-platform-core/xwiki-platform-model/xwiki-platform-model-validation/xwiki-platform-model-validation-default/src/main/resources/ApplicationResources_de.properties +++ /dev/null @@ -1,24 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- -entitynamevalidation.ReplaceCharacterEntityNameValidation.name=Zeichenersetzung -entitynamevalidation.ReplaceCharacterEntityNameValidation.usage=Einige Zeichen sind bei dieser Strategie verboten und sollten ersetzt oder entfernt werden. Erkundige Dich bei deinem Administrator nach der genauen Liste der verbotenen Zeichen und nach dem zu verwendenden Ersatz. -## Missing: entitynamevalidation.ReplaceCharacterEntityNameValidation.usage=Some characters are forbidden with this strategy and should be replaced or removed. Ask your administrator to know exactly the list of forbidden characters, and the replacement to use. -entitynamevalidation.SlugEntityNameValidation.name=Vorformatierte Namen (keine Akzente, kein Leerzeichen, keine Sonderzeichen) -entitynamevalidation.SlugEntityNameValidation.usage=Alle Sonderzeichen, einschlie\u00DFlich Leerzeichen und Akzente, sind verboten. diff --git a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/pom.xml b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/pom.xml index 9eb2d5a2150b..cd2d21cd800f 100644 --- a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/pom.xml @@ -63,9 +63,10 @@ ${project.version} - javax.websocket - javax.websocket-api + jakarta.websocket + jakarta.websocket-client-api + org.xwiki.commons @@ -73,5 +74,15 @@ ${commons.version} test + + jakarta.servlet + jakarta.servlet-api + test + + + jakarta.websocket + jakarta.websocket-api + test + diff --git a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/DefaultEntityChannelStoreTest.java b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/DefaultEntityChannelStoreTest.java index 35dce1a5d652..c04a12100952 100644 --- a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/DefaultEntityChannelStoreTest.java +++ b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/DefaultEntityChannelStoreTest.java @@ -26,7 +26,7 @@ import java.util.List; -import javax.websocket.Session; +import jakarta.websocket.Session; import org.junit.jupiter.api.Test; import org.mockito.Mock; diff --git a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/EntityChannelScriptAuthorBotTest.java b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/EntityChannelScriptAuthorBotTest.java index 0a27fdb81c8a..bdce80c4e834 100644 --- a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/EntityChannelScriptAuthorBotTest.java +++ b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-api/src/test/java/org/xwiki/netflux/internal/EntityChannelScriptAuthorBotTest.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.Optional; -import javax.websocket.Session; +import jakarta.websocket.Session; import org.junit.jupiter.api.Test; import org.xwiki.model.reference.DocumentReference; diff --git a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-rest/pom.xml b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-rest/pom.xml index bbb09cb6105e..c1f726a787d5 100644 --- a/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-rest/pom.xml +++ b/xwiki-platform-core/xwiki-platform-netflux/xwiki-platform-netflux-rest/pom.xml @@ -59,6 +59,7 @@ jakarta.ws.rs jakarta.ws.rs-api + org.xwiki.commons @@ -72,8 +73,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-api/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-api/pom.xml index 38daebe3fdfc..6574e8211ac5 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-api/pom.xml @@ -72,8 +72,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-default/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-default/pom.xml index 0c8c424c37ac..40cc4fa872b0 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-default/pom.xml @@ -58,11 +58,6 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-oldcore diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-watch/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-watch/pom.xml index 6cd9a79e5305..c234fdb17b19 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-watch/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-filters/xwiki-platform-notifications-filters-watch/pom.xml @@ -52,8 +52,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-api/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-api/pom.xml index 3c8b4eded7d6..665c5deae98e 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-api/pom.xml @@ -81,11 +81,6 @@ ${rendering.version} test - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-test-oldcore diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-default/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-default/pom.xml index 3eb4fd403cf3..2c981e38903a 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-notifiers/xwiki-platform-notifications-notifiers-default/pom.xml @@ -75,8 +75,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-api/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-api/pom.xml index 43a913d95a2d..ebd870a48058 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-api/pom.xml @@ -60,8 +60,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-default/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-default/pom.xml index 803d38c94ee9..1fd261643d38 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-preferences/xwiki-platform-notifications-preferences-default/pom.xml @@ -57,8 +57,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-rest/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-rest/pom.xml index f726e3322fa8..1528d54be022 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-rest/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-rest/pom.xml @@ -76,9 +76,8 @@ rome - javax.servlet - javax.servlet-api - compile + jakarta.servlet + jakarta.servlet-api org.xwiki.commons diff --git a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-sources/pom.xml b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-sources/pom.xml index 8dbf3fb7de8c..5f5238751304 100644 --- a/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-sources/pom.xml +++ b/xwiki-platform-core/xwiki-platform-notifications/xwiki-platform-notifications-sources/pom.xml @@ -75,8 +75,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-observation/xwiki-platform-observation-test/xwiki-platform-observation-test-tests/pom.xml b/xwiki-platform-core/xwiki-platform-observation/xwiki-platform-observation-test/xwiki-platform-observation-test-tests/pom.xml index 223957f96a7b..6f141f8b67d9 100644 --- a/xwiki-platform-core/xwiki-platform-observation/xwiki-platform-observation-test/xwiki-platform-observation-test-tests/pom.xml +++ b/xwiki-platform-core/xwiki-platform-observation/xwiki-platform-observation-test/xwiki-platform-observation-test-tests/pom.xml @@ -105,8 +105,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-oldcore/pom.xml b/xwiki-platform-core/xwiki-platform-oldcore/pom.xml index 8277c275dd33..71799ea2f0fa 100644 --- a/xwiki-platform-core/xwiki-platform-oldcore/pom.xml +++ b/xwiki-platform-core/xwiki-platform-oldcore/pom.xml @@ -130,6 +130,10 @@ javax.servlet javax.servlet-api + + jakarta.servlet + jakarta.servlet-api + - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-api/pom.xml b/xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-api/pom.xml index 853c07e6cd3c..e3441687463a 100644 --- a/xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-realtime/xwiki-platform-realtime-api/pom.xml @@ -67,8 +67,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/pom.xml b/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/pom.xml index 60fdfe848c09..00e168a82221 100644 --- a/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-refactoring/xwiki-platform-refactoring-default/pom.xml @@ -62,11 +62,6 @@ - - javax.servlet - javax.servlet-api - test - org.xwiki.commons xwiki-commons-tool-test-component diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-macro/pom.xml b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-macro/pom.xml index 099f2e7ecd05..0ff45cf6b107 100644 --- a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-macro/pom.xml +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-async/xwiki-platform-rendering-async-macro/pom.xml @@ -83,8 +83,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/pom.xml b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/pom.xml index 2bb052d4262b..b7db42c64772 100644 --- a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/pom.xml +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-context/pom.xml @@ -69,8 +69,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-store/pom.xml b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-store/pom.xml index ded8b93c053e..b31f2930129b 100644 --- a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-store/pom.xml +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-wikimacro/xwiki-platform-rendering-wikimacro-store/pom.xml @@ -166,12 +166,6 @@ apache-el test - - - org.jmock - jmock-legacy - test - diff --git a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/pom.xml b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/pom.xml index 03f817a84f5b..9ffa66e8a9a2 100644 --- a/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/pom.xml +++ b/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-xwiki/pom.xml @@ -119,11 +119,6 @@ xwiki-platform-localization-api ${project.version} - diff --git a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/pom.xml b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/pom.xml index 80bbfec32f51..0ff21c690fcc 100644 --- a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/pom.xml +++ b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/pom.xml @@ -48,10 +48,11 @@ xwiki-platform-tika-detect ${project.version} - - javax.servlet - javax.servlet-api + + jakarta.servlet + jakarta.servlet-api + org.xwiki.commons diff --git a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/AbstractServletResourceReferenceHandler.java b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/AbstractServletResourceReferenceHandler.java index 7cdb6d3004be..374304fa83c4 100644 --- a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/AbstractServletResourceReferenceHandler.java +++ b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/AbstractServletResourceReferenceHandler.java @@ -27,9 +27,6 @@ import java.util.Date; import java.util.Objects; -import javax.inject.Inject; -import javax.servlet.http.HttpServletResponse; - import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpHeaders; @@ -48,6 +45,9 @@ import org.xwiki.resource.ResourceType; import org.xwiki.tika.internal.TikaUtils; +import jakarta.inject.Inject; +import jakarta.servlet.http.HttpServletResponse; + /** * Base class for {@link ResourceReferenceHandler}s that can handle servlet resource requests. * @@ -122,18 +122,19 @@ private boolean shouldBrowserUseCachedContent(R resourceReference) // If the request contains an "If-Modified-Since" header and the requested resource has not been modified then // return a 304 Not Modified to tell the browser to use its cached version. Request request = this.container.getRequest(); - if (request instanceof ServletRequest - && ((ServletRequest) request).getHttpServletRequest().getHeader("If-Modified-Since") != null - && isResourceCacheable(resourceReference)) - { + if (request instanceof ServletRequest servletRequest + && servletRequest.getJakartaHttpServletRequest().getHeader("If-Modified-Since") != null + && isResourceCacheable(resourceReference)) { // The user probably used F5 to reload the page and the browser checks if there are changes. Response response = this.container.getResponse(); - if (response instanceof ServletResponse) { + if (response instanceof ServletResponse servletResponse) { // Return the 304 Not Modified. - ((ServletResponse) response).getHttpServletResponse().setStatus(HttpServletResponse.SC_NOT_MODIFIED); + servletResponse.getJakartaHttpServletResponse().setStatus(HttpServletResponse.SC_NOT_MODIFIED); + return true; } } + return false; } @@ -169,7 +170,7 @@ private void serveResource(R resourceReference, InputStream rawResourceStream) throws ResourceReferenceHandlerException { InputStream resourceStream = rawResourceStream; - + // Make sure the resource stream supports mark & reset which is needed in order be able to detect the // content type without affecting the stream (Tika may need to read a few bytes from the start of the // stream, in which case it will mark & reset the stream). @@ -189,8 +190,8 @@ private void serveResource(R resourceReference, InputStream rawResourceStream) } /** - * Computes the content type of the resource. By default the content type is inferred by {@link - * TikaUtils#detect(InputStream, String)} based on the resource content and name. + * Computes the content type of the resource. By default the content type is inferred by + * {@link TikaUtils#detect(InputStream, String)} based on the resource content and name. * * @param resourceStream the stream of the requested resource * @param resourceReference the reference of the request resource @@ -198,8 +199,7 @@ private void serveResource(R resourceReference, InputStream rawResourceStream) * @throws IOException in case of error during the content type analysis * @since 13.3RC1 */ - protected String getContentType(InputStream resourceStream, R resourceReference) - throws IOException + protected String getContentType(InputStream resourceStream, R resourceReference) throws IOException { return TikaUtils.detect(resourceStream, getResourceName(resourceReference)); } @@ -228,7 +228,7 @@ private void setResponseHeaders(Response response, R resourceReference) if (!(response instanceof ServletResponse)) { return; } - HttpServletResponse httpResponse = ((ServletResponse) response).getHttpServletResponse(); + HttpServletResponse httpResponse = ((ServletResponse) response).getJakartaHttpServletResponse(); // Cache the resource if possible. if (isResourceCacheable(resourceReference)) { @@ -288,8 +288,9 @@ private void sendError(int statusCode, String message, Object... parameters) throws ResourceReferenceHandlerException { Response response = this.container.getResponse(); - if (response instanceof ServletResponse) { - HttpServletResponse httpResponse = ((ServletResponse) response).getHttpServletResponse(); + if (response instanceof ServletResponse servletResponse) { + HttpServletResponse httpResponse = servletResponse.getJakartaHttpServletResponse(); + try { httpResponse.sendError(statusCode, String.format(message, parameters)); } catch (IOException e) { diff --git a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/ResourceReferenceHandlerServlet.java b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/ResourceReferenceHandlerServlet.java index c0b733882a84..00ec33ca78a0 100644 --- a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/ResourceReferenceHandlerServlet.java +++ b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/ResourceReferenceHandlerServlet.java @@ -23,11 +23,6 @@ import java.lang.reflect.Type; import java.util.Collections; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.component.manager.ComponentManager; import org.xwiki.component.util.DefaultParameterizedType; @@ -42,14 +37,22 @@ import org.xwiki.resource.ResourceType; import org.xwiki.url.ExtendedURL; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * Handles any Resource Reference discovered by the Routing Filter and put in the HTTP Request. Any module who wish to * add a new Resource Type in the XWiki URL simply needs to register a Handler component (of role * {@link org.xwiki.resource.ResourceReferenceHandler}) and any URL matching the corresponding {@link ResourceType} will * be handled. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implements a completely + * different API from Java point of view. * * @version $Id$ - * @since 7.1M1 + * @since 42.0.0 */ public class ResourceReferenceHandlerServlet extends HttpServlet { @@ -58,7 +61,7 @@ public class ResourceReferenceHandlerServlet extends HttpServlet */ private static final long serialVersionUID = 1L; - private ComponentManager rootComponentManager; + private transient ComponentManager rootComponentManager; @Override public void init() throws ServletException @@ -136,9 +139,7 @@ private void initializeContainerComponent(HttpServletRequest httpRequest, HttpSe throw new ServletException("Failed to locate a ServletContainerInitializer component", e); } try { - containerInitializer.initializeRequest(httpRequest); - containerInitializer.initializeResponse(httpResponse); - containerInitializer.initializeSession(httpRequest); + containerInitializer.initializeRequest(httpRequest, httpResponse); } catch (ServletContainerException e) { throw new ServletException("Failed to initialize Request/Response or Session", e); } diff --git a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/RoutingFilter.java b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/RoutingFilter.java index 96683321275a..b2fa1d1456f2 100644 --- a/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/RoutingFilter.java +++ b/xwiki-platform-core/xwiki-platform-resource/xwiki-platform-resource-servlet/src/main/java/org/xwiki/resource/servlet/RoutingFilter.java @@ -24,14 +24,14 @@ import java.net.URL; import java.util.Collections; -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; -import javax.servlet.http.HttpServletRequest; +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 jakarta.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.xwiki.component.manager.ComponentLookupException; @@ -46,23 +46,26 @@ /** * Decides how to route an incoming URL into the XWiki system. There are various possibilities: *

    - *
  • If there's a registered component of type {@link org.xwiki.resource.ResourceReferenceHandler} matching the - * {@link ResourceType} passed in the URL (for example when using the {@code standard} URL scheme, the Resource - * Type is the segment path just after the Context Path, i.e. {@code bin} in - * {@code http:///xwiki/bin/view/Space/Page}), then the {@code resourceReferenceHandler} Servlet is - * called to handle it.
  • - *
  • If not, then continue executing the rest of the {@code web.xml} file, thus bridging to the old system, - * including the existing Struts Action Servlet.
  • + *
  • If there's a registered component of type {@link org.xwiki.resource.ResourceReferenceHandler} matching the + * {@link ResourceType} passed in the URL (for example when using the {@code standard} URL scheme, the Resource Type is + * the segment path just after the Context Path, i.e. {@code bin} in {@code http:///xwiki/bin/view/Space/Page}), + * then the {@code resourceReferenceHandler} Servlet is called to handle it.
  • + *
  • If not, then continue executing the rest of the {@code web.xml} file, thus bridging to the old system, including + * the existing Struts Action Servlet.
  • *
* As time progresses it is expected that more and more Resource Types will have registered * {@link org.xwiki.resource.ResourceReferenceHandler}. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely different + * API from Java point of view. * * @version $Id$ - * @since 7.1M1 + * @since 42.0.0 */ public class RoutingFilter implements Filter { static final String RESOURCE_TYPE_NAME = "resourceType"; + static final String RESOURCE_EXTENDEDURL = "resourceURL"; private ComponentManager rootComponentManager; @@ -169,8 +172,8 @@ private ResourceTypeResolver getResourceTypeResolver() throws Servl { ResourceTypeResolver urlResourceTypeResolver; try { - urlResourceTypeResolver = this.rootComponentManager.getInstance( - new DefaultParameterizedType(null, ResourceTypeResolver.class, ExtendedURL.class)); + urlResourceTypeResolver = this.rootComponentManager + .getInstance(new DefaultParameterizedType(null, ResourceTypeResolver.class, ExtendedURL.class)); } catch (ComponentLookupException e) { // Should not happen since an ExtendedURL Resource Type Resolver should exist on the system. throw new ServletException("Failed to locate an ExtendedURL Resource Type Resolver component", e); @@ -208,7 +211,8 @@ private URL getRequestURL(HttpServletRequest request) throws ServletException // Shouldn't happen normally! throw new ServletException( String.format("Failed to reconstruct URL from HTTP Servlet Request (URL [%s], Query String [%s])", - request.getRequestURL(), request.getQueryString()), e); + request.getRequestURL(), request.getQueryString()), + e); } return url; } diff --git a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/pom.xml b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/pom.xml index a9790de8e685..8d962781d30c 100644 --- a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/pom.xml +++ b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/pom.xml @@ -84,8 +84,13 @@ aopalliance - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api + + + org.xwiki.commons + xwiki-commons-jakartabridge-servlet + ${commons.version} diff --git a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/JerseyServletContainer.java b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/JerseyServletContainer.java index 630611267ede..aaa994920a13 100644 --- a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/JerseyServletContainer.java +++ b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/JerseyServletContainer.java @@ -24,28 +24,32 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import javax.inject.Inject; -import javax.inject.Named; -import javax.inject.Singleton; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; - import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; import org.xwiki.component.annotation.Component; import org.xwiki.component.descriptor.ComponentDescriptor; import org.xwiki.component.manager.ComponentManager; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; import org.xwiki.rest.XWikiRestComponent; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import jakarta.inject.Singleton; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; + /** * Encapsulate the Jersey {@link ServletContainer} to control it's initialization and reload (when a REST component is * registered/unregistered). + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely different + * API from Java point of view. * * @version $Id$ - * @since 16.2.0RC1 + * @since 42.0.0 */ @Component(roles = JerseyServletContainer.class) @Singleton @@ -66,7 +70,11 @@ public void init() throws ServletException { // Create and initialize the Jersey servlet ServletContainer newContainer = new ServletContainer(createResourceConfig()); - newContainer.init(getServletConfig()); + try { + newContainer.init(JakartaServletBridge.toJavax(getServletConfig())); + } catch (javax.servlet.ServletException e) { + throw new ServletException(e); + } // Remember the previous container ServletContainer previousContainer = this.container; @@ -128,7 +136,9 @@ public void service(ServletRequest req, ServletResponse res) throws ServletExcep try { // Execute the request - this.container.service(req, res); + this.container.service(JakartaServletBridge.toJavax(req), JakartaServletBridge.toJavax(res)); + } catch (javax.servlet.ServletException e) { + throw new ServletException(e); } finally { // Decrement the counter counter.decrementAndGet(); @@ -159,6 +169,6 @@ public void destroy() @Override public ServletContext getServletContext() { - return this.container.getServletContext(); + return JakartaServletBridge.toJakarta(this.container.getServletContext()); } } diff --git a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/XWikiRESTServlet.java b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/XWikiRESTServlet.java index b433c07cbc31..9051119406c9 100644 --- a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/XWikiRESTServlet.java +++ b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-jersey/src/main/java/org/xwiki/rest/jersey/internal/XWikiRESTServlet.java @@ -21,25 +21,28 @@ import java.io.IOException; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; - import org.glassfish.jersey.servlet.ServletContainer; import org.glassfish.jersey.servlet.ServletProperties; import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.component.manager.ComponentManager; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServlet; + /** * Extends {@link ServletContainer} to add XWiki specific pieces. *

    *
  • Injection of XWikiResource components
  • *
+ *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely different + * API from Java point of view. * * @version $Id$ - * @since 16.2.0RC1 + * @since 42.0.0 */ public class XWikiRESTServlet extends HttpServlet { diff --git a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/pom.xml b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/pom.xml index 860c8d3ad26c..817b10b6565e 100644 --- a/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/pom.xml +++ b/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/pom.xml @@ -129,6 +129,10 @@ javax.servlet javax.servlet-api + + jakarta.servlet + jakarta.servlet-api + org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-scheduler/xwiki-platform-scheduler-api/pom.xml b/xwiki-platform-core/xwiki-platform-scheduler/xwiki-platform-scheduler-api/pom.xml index a09be68f3089..83d24dd31cb9 100644 --- a/xwiki-platform-core/xwiki-platform-scheduler/xwiki-platform-scheduler-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-scheduler/xwiki-platform-scheduler-api/pom.xml @@ -47,8 +47,8 @@ quartz - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/pom.xml b/xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/pom.xml index ef4ff8519d1f..87d8d8b1f3a3 100644 --- a/xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-search/xwiki-platform-search-solr/xwiki-platform-search-solr-api/pom.xml @@ -134,11 +134,6 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - test - org.xwiki.platform xwiki-platform-test-oldcore diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/pom.xml b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/pom.xml index 090702dc69d3..7c4da667a83e 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/pom.xml @@ -77,8 +77,13 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api + + + org.xwiki.commons + xwiki-commons-jakartabridge-servlet + ${commons.version} diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureManager.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureManager.java index 33318e7dd175..8a3db61c99cd 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureManager.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureManager.java @@ -19,10 +19,12 @@ */ package org.xwiki.security.authentication; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.xwiki.component.annotation.Role; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; import org.xwiki.model.reference.DocumentReference; +import org.xwiki.stability.Unstable; /** * Manager of the authentication failures strategies. @@ -35,12 +37,33 @@ public interface AuthenticationFailureManager { /** * Record that the given username fails to authenticate. + * * @param username the username that fails the authentication. Should be the username typed by the user and not a - * computed login. + * computed login. * @param request a wrapping of the request used for the authentication. * @return true if the authentication failure limits defined by the configuration has been reached. + * @deprecated use {@link #recordAuthenticationFailure(String, HttpServletRequest)} */ - boolean recordAuthenticationFailure(String username, HttpServletRequest request); + @Deprecated(since = "42.0.0") + default boolean recordAuthenticationFailure(String username, javax.servlet.http.HttpServletRequest request) + { + return recordAuthenticationFailure(username, JakartaServletBridge.toJakarta(request)); + } + + /** + * Record that the given username fails to authenticate. + * + * @param username the username that fails the authentication. Should be the username typed by the user and not a + * computed login. + * @param request a wrapping of the request used for the authentication. + * @return true if the authentication failure limits defined by the configuration has been reached. + * @since 42.0.0 + */ + @Unstable + default boolean recordAuthenticationFailure(String username, HttpServletRequest request) + { + return recordAuthenticationFailure(username, JakartaServletBridge.toJavax(request)); + } /** * Remove all records of authentication failure for the given user. @@ -56,19 +79,62 @@ public interface AuthenticationFailureManager * not a computed login. * @param request a wrapping of the request used for the authentication. * @return the aggregated form information to add to the standard login form, or an empty string. + * @deprecated use {@link #getForm(String, HttpServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + default String getForm(String username, javax.servlet.http.HttpServletRequest request) + { + return getForm(username, JakartaServletBridge.toJakarta(request)); + } + + /** + * If the user reached the authentication failure limit, aggregate form information returned by the different + * strategies (see {@link AuthenticationFailureStrategy#getForm(String)}). Else return an empty string. + * @param username the username that is used for the authentication. Should be the username typed by the user and + * not a computed login. + * @param request a wrapping of the request used for the authentication. + * @return the aggregated form information to add to the standard login form, or an empty string. + * @since 42.0.0 */ - String getForm(String username, HttpServletRequest request); + @Unstable + default String getForm(String username, HttpServletRequest request) + { + return getForm(username, JakartaServletBridge.toJavax(request)); + } /** * If the user reached the authentication failure limit, validate the form information against the different - * strategies used and return the result - * (see {@link AuthenticationFailureStrategy#validateForm(String, HttpServletRequest)}). Else returns true. + * strategies used and return the result (see + * {@link AuthenticationFailureStrategy#validateForm(String, HttpServletRequest)}). Else returns true. + * * @param username the username that is used for the authentication. Should be the username typed by the user and - * not a computed login. + * not a computed login. + * @param request a wrapping of the request used for the authentication. + * @return true if all strategies validate the request or if the user didn't reach the limit. + * @deprecated use {@link #validateForm(String, HttpServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + default boolean validateForm(String username, javax.servlet.http.HttpServletRequest request) + { + return validateForm(username, JakartaServletBridge.toJakarta(request)); + } + + /** + * If the user reached the authentication failure limit, validate the form information against the different + * strategies used and return the result (see + * {@link AuthenticationFailureStrategy#validateForm(String, HttpServletRequest)}). Else returns true. + * + * @param username the username that is used for the authentication. Should be the username typed by the user and + * not a computed login. * @param request a wrapping of the request used for the authentication. * @return true if all strategies validate the request or if the user didn't reach the limit. + * @since 42.0.0 */ - boolean validateForm(String username, HttpServletRequest request); + @Unstable + default boolean validateForm(String username, HttpServletRequest request) + { + return validateForm(username, JakartaServletBridge.toJavax(request)); + } /** * If the user reached the authentication failure limit, aggregate the error message of the different strategies diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureStrategy.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureStrategy.java index a57f5b319fba..1abca3995d49 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureStrategy.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-api/src/main/java/org/xwiki/security/authentication/AuthenticationFailureStrategy.java @@ -19,9 +19,11 @@ */ package org.xwiki.security.authentication; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.xwiki.component.annotation.Role; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; /** * Describes a strategy to perform in case the limit of authentication failures is reached. @@ -57,8 +59,25 @@ public interface AuthenticationFailureStrategy * @param username the username used for the authentication failure. * @param request the authentication request. * @return true if the authentication request can be validated, i.e. if the user should be authorized to login. + * @deprecated use {@link #validateForm(String, HttpServletRequest)} instead */ - boolean validateForm(String username, HttpServletRequest request); + @Deprecated(since = "42.0.0") + default boolean validateForm(String username, javax.servlet.http.HttpServletRequest request) + { + return validateForm(username, JakartaServletBridge.toJakarta(request)); + } + + /** + * @param username the username used for the authentication failure. + * @param request the authentication request. + * @return true if the authentication request can be validated, i.e. if the user should be authorized to login. + * @since 42.0.0 + */ + @Unstable + default boolean validateForm(String username, HttpServletRequest request) + { + return validateForm(username, JakartaServletBridge.toJavax(request)); + } /** * Notify the strategy about an authentication failure limit reached. diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/pom.xml b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/pom.xml index 091f31f0474e..85c80b5b4e28 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/pom.xml @@ -31,7 +31,7 @@ Default implementation of the Authentication API ${basedir}/src/checkstyle/checkstyle-suppressions.xml - 0.80 + 0.79 Authentication API Implementation @@ -78,8 +78,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/CaptchaAuthenticationFailureStrategy.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/CaptchaAuthenticationFailureStrategy.java index 965a00579ce7..0aa393e1cb94 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/CaptchaAuthenticationFailureStrategy.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/CaptchaAuthenticationFailureStrategy.java @@ -25,7 +25,6 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; @@ -38,10 +37,11 @@ import org.xwiki.localization.ContextualLocalizationManager; import org.xwiki.security.authentication.AuthenticationFailureStrategy; +import jakarta.servlet.http.HttpServletRequest; + /** - * Captcha Strategy for repeated authentication failures. - * The main idea of this strategy is to add a captcha form field in the login form and to ask user to fill it for - * validating their authentication. + * Captcha Strategy for repeated authentication failures. The main idea of this strategy is to add a captcha form field + * in the login form and to ask user to fill it for validating their authentication. * * @version $Id$ * @since 11.6RC1 @@ -54,8 +54,8 @@ public class CaptchaAuthenticationFailureStrategy implements AuthenticationFailu /** * Exception message thrown by jCaptcha library when no captcha is registered for the session id. */ - private static final String UNEXISTING_CAPTCHA_EXCEPTION = "Invalid ID, could not validate unexisting or already " - + "validated captcha"; + private static final String UNEXISTING_CAPTCHA_EXCEPTION = + "Invalid ID, could not validate unexisting or already " + "validated captcha"; @Inject private CaptchaConfiguration captchaConfiguration; diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManager.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManager.java index 2a8359b30f68..5e055761601d 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManager.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManager.java @@ -32,7 +32,6 @@ import javax.inject.Named; import javax.inject.Provider; import javax.inject.Singleton; -import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -58,6 +57,8 @@ import com.xpn.xwiki.XWikiContext; import com.xpn.xwiki.user.api.XWikiUser; +import jakarta.servlet.http.HttpServletRequest; + /** * Default implementation for {@link AuthenticationFailureManager}. * @@ -134,8 +135,8 @@ private void buildStrategyList() this.failureStrategyList = new LinkedList<>(); for (String failureStrategyName : this.failureStrategyNames) { try { - this.failureStrategyList.add(this.componentManager.getInstance(AuthenticationFailureStrategy.class, - failureStrategyName)); + this.failureStrategyList + .add(this.componentManager.getInstance(AuthenticationFailureStrategy.class, failureStrategyName)); } catch (ComponentLookupException e) { logger.error("Error while getting authentication failure strategy [{}]. ", failureStrategyName, e); } @@ -156,9 +157,7 @@ private boolean isAuthenticationSecurityEnabled() { // historically the feature was considered as disabled if max attempts = 0, max time = 0 or the strategy list // was empty. We keep that as possible way to say it's disabled. - return configuration.isAuthenticationSecurityEnabled() - && getMaxNbAttempts() != 0 - && getMaxTime() != 0 + return configuration.isAuthenticationSecurityEnabled() && getMaxNbAttempts() != 0 && getMaxTime() != 0 && !getFailureStrategyList().isEmpty(); } @@ -169,9 +168,9 @@ private void clearRecords() } /** - * Determine which username we should skip. - * We don't handle empty usernames to avoid triggering the security mechanism for nothing and having unexpected - * behaviours. + * Determine which username we should skip. We don't handle empty usernames to avoid triggering the security + * mechanism for nothing and having unexpected behaviours. + * * @param username the username to check. * @return {@code true} if the username is empty. */ @@ -350,14 +349,14 @@ private int getMaxNbAttempts() } /** - * This class aims at storing the authentication failure record information about a login. - * It only stores the first failing date and the number of failing attempts since then. - * Those two are resetted if another failure happens outside of the given time window. - * (See {@link AuthenticationConfiguration#getTimeWindow()}) + * This class aims at storing the authentication failure record information about a login. It only stores the first + * failing date and the number of failing attempts since then. Those two are resetted if another failure happens + * outside of the given time window. (See {@link AuthenticationConfiguration#getTimeWindow()}) */ class AuthFailureRecord { private long firstFailingDate; + private int nbAttempts; AuthFailureRecord() @@ -374,12 +373,12 @@ void incrementAttemptOrReset() this.firstFailingDate = new Date().getTime(); this.nbAttempts++; - // If the threshold not reached yet and we're out of the time window, we can reset the data. + // If the threshold not reached yet and we're out of the time window, we can reset the data. } else if (firstFailingDate + getMaxTime() < new Date().getTime()) { this.firstFailingDate = new Date().getTime(); this.nbAttempts = 1; - // Else the threshold not reached but we are in the time window: we increment the number of attempts. + // Else the threshold not reached but we are in the time window: we increment the number of attempts. } else { this.nbAttempts++; } diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategy.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategy.java index 38cff2df7285..1e71b99a025a 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategy.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/main/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategy.java @@ -26,7 +26,6 @@ import javax.inject.Named; import javax.inject.Provider; import javax.inject.Singleton; -import javax.servlet.http.HttpServletRequest; import org.xwiki.bridge.event.DocumentUpdatedEvent; import org.xwiki.component.annotation.Component; @@ -45,6 +44,8 @@ import com.xpn.xwiki.objects.BaseObject; import com.xpn.xwiki.user.api.XWikiUser; +import jakarta.servlet.http.HttpServletRequest; + /** * A strategy to disable authentication in case of repeated failure with a login. *

@@ -109,6 +110,7 @@ public boolean validateForm(String username, HttpServletRequest request) if (userDocumentReference != null) { return !new XWikiUser(userDocumentReference).isDisabled(this.contextProvider.get()); } + return false; } diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManagerTest.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManagerTest.java index c37fed206dd5..22d4e5972686 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManagerTest.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DefaultAuthenticationFailureManagerTest.java @@ -25,8 +25,8 @@ import javax.inject.Named; import javax.inject.Provider; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpSession; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -74,7 +74,7 @@ * @since 11.6RC1 */ @ComponentTest -public class DefaultAuthenticationFailureManagerTest +class DefaultAuthenticationFailureManagerTest { @InjectMockComponents private DefaultAuthenticationFailureManager defaultAuthenticationFailureManager; @@ -163,7 +163,7 @@ private HttpServletRequest getRequest(String sessionId) * Ensure that a AuthenticationFailureEvent is triggered. */ @Test - public void authenticationFailureIsTriggered() + void authenticationFailureIsTriggered() { assertFalse(this.defaultAuthenticationFailureManager.recordAuthenticationFailure(this.failingLogin, getRequest("something"))); @@ -234,7 +234,7 @@ void authenticationFailureEmptyLogin() * Ensure that the time window configuration is taken into account properly. */ @Test - public void repeatedAuthenticationFailureOutOfTimeWindow() throws InterruptedException + void repeatedAuthenticationFailureOutOfTimeWindow() throws InterruptedException { HttpServletRequest request = getRequest("anotherId"); when(configuration.getTimeWindow()).thenReturn(1); @@ -258,7 +258,7 @@ public void repeatedAuthenticationFailureOutOfTimeWindow() throws InterruptedExc * Ensure that the max attempt configuration is taken into account properly. */ @Test - public void repeatedAuthenticationFailureDifferentThreshold() + void repeatedAuthenticationFailureDifferentThreshold() { HttpServletRequest request = getRequest("foobar"); when(configuration.getMaxAuthorizedAttempts()).thenReturn(5); @@ -281,7 +281,7 @@ public void repeatedAuthenticationFailureDifferentThreshold() * Ensure that the failure record reset is working properly. */ @Test - public void resetAuthFailureRecord() + void resetAuthFailureRecord() { HttpServletRequest request = getRequest("reset"); assertFalse(this.defaultAuthenticationFailureManager.recordAuthenticationFailure(this.failingLogin, request)); @@ -304,7 +304,7 @@ public void resetAuthFailureRecord() * Ensure that the failure record reset is working properly. */ @Test - public void resetAuthFailureRecordWithDocumentReference() + void resetAuthFailureRecordWithDocumentReference() { HttpServletRequest request = getRequest("reset2"); assertFalse(this.defaultAuthenticationFailureManager.recordAuthenticationFailure(this.failingLogin, request)); @@ -327,7 +327,7 @@ public void resetAuthFailureRecordWithDocumentReference() * Ensure that the threshold mechanism works properly with different login. */ @Test - public void recordAuthFailureDifferentLogin() + void recordAuthFailureDifferentLogin() { HttpServletRequest request = getRequest("multilogin"); String login1 = this.failingLogin.toLowerCase(); @@ -390,7 +390,7 @@ void recordAuthenticationFailureWithFailingSession() * Ensure that the authentication threshold auth is deactivated if max attempt is set to 0 */ @Test - public void deactivateThresholdAuthWithMaxAttempt() + void deactivateThresholdAuthWithMaxAttempt() { HttpServletRequest request = getRequest("manyattempt"); when(this.configuration.getMaxAuthorizedAttempts()).thenReturn(0); @@ -410,7 +410,7 @@ public void deactivateThresholdAuthWithMaxAttempt() * Ensure that the authentication threshold auth is deactivated if time window is set to 0 */ @Test - public void deactivateThresholdAuthWithTimeWindow() + void deactivateThresholdAuthWithTimeWindow() { HttpServletRequest request = getRequest("manyattempt2"); when(this.configuration.getTimeWindow()).thenReturn(0); @@ -430,7 +430,7 @@ public void deactivateThresholdAuthWithTimeWindow() * Validate that getForm is working properly. */ @Test - public void getForm() + void getForm() { HttpServletRequest request = getRequest("getForm"); String formStrategy1 = "formStrategy1"; @@ -468,7 +468,7 @@ void getFormFailingSession() * Validate that getErrorMessages is working properly. */ @Test - public void getErrorMessages() + void getErrorMessages() { HttpServletRequest request = getRequest("errorMsg"); String errorMessage1 = "errorMessage1"; @@ -489,7 +489,7 @@ public void getErrorMessages() * Validate that getForm is working properly. */ @Test - public void validateForm() + void validateForm() { HttpServletRequest request = getRequest("validate"); String login1 = this.failingLogin; @@ -506,13 +506,13 @@ public void validateForm() this.defaultAuthenticationFailureManager.recordAuthenticationFailure(login2, request); this.defaultAuthenticationFailureManager.recordAuthenticationFailure(login2, request); - when(this.strategy1.validateForm(login1, null)).thenReturn(true); - when(this.strategy2.validateForm(login1, null)).thenReturn(true); - assertTrue(this.defaultAuthenticationFailureManager.validateForm(login1, null)); + when(this.strategy1.validateForm(login1, (HttpServletRequest) null)).thenReturn(true); + when(this.strategy2.validateForm(login1, (HttpServletRequest) null)).thenReturn(true); + assertTrue(this.defaultAuthenticationFailureManager.validateForm(login1, (HttpServletRequest) null)); - when(this.strategy1.validateForm(login2, null)).thenReturn(true); - when(this.strategy2.validateForm(login2, null)).thenReturn(false); - assertFalse(this.defaultAuthenticationFailureManager.validateForm(login2, null)); + when(this.strategy1.validateForm(login2, (HttpServletRequest) null)).thenReturn(true); + when(this.strategy2.validateForm(login2, (HttpServletRequest) null)).thenReturn(false); + assertFalse(this.defaultAuthenticationFailureManager.validateForm(login2, (HttpServletRequest) null)); } @Test @@ -531,7 +531,7 @@ void validateFormFailingSession() * Validate that getUser is working properly. */ @Test - public void getUserNotFound() throws XWikiException + void getUserNotFound() throws XWikiException { when(context.getMainXWiki()).thenReturn("mainwiki"); when(context.getWikiId()).thenReturn("currentwiki"); @@ -553,7 +553,7 @@ public void getUserNotFound() throws XWikiException * Validate that getUser is working properly. */ @Test - public void getUserGlobalFound() throws XWikiException + void getUserGlobalFound() throws XWikiException { when(context.getMainXWiki()).thenReturn("mainwiki"); DocumentReference globalReference = new DocumentReference("mainwiki", "XWiki", "foo"); @@ -575,7 +575,7 @@ public void getUserGlobalFound() throws XWikiException * Validate that getUser is working properly. */ @Test - public void getUserLocalFound() throws XWikiException + void getUserLocalFound() throws XWikiException { when(context.getMainXWiki()).thenReturn("mainwiki"); when(context.getWikiId()).thenReturn("currentwiki"); @@ -597,7 +597,7 @@ public void getUserLocalFound() throws XWikiException } @Test - public void strategiesAreRebuildInCaseOfReset() + void strategiesAreRebuildInCaseOfReset() { HttpServletRequest request = getRequest("reset"); when(configuration.getFailureStrategies()).thenReturn(new String[] { "strategy1" }); diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategyTest.java b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategyTest.java index f5cabc1afc92..d033d8b7638f 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategyTest.java +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-default/src/test/java/org/xwiki/security/authentication/internal/DisableAccountFailureStrategyTest.java @@ -19,6 +19,12 @@ */ package org.xwiki.security.authentication.internal; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import javax.inject.Provider; import org.junit.jupiter.api.BeforeEach; @@ -32,16 +38,9 @@ import org.xwiki.test.junit5.mockito.InjectMockComponents; import org.xwiki.test.junit5.mockito.MockComponent; -import com.xpn.xwiki.XWikiException; import com.xpn.xwiki.doc.XWikiDocument; import com.xpn.xwiki.objects.BaseObject; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - /** * Unit tests for {@link DisableAccountFailureStrategy}. * @@ -49,7 +48,7 @@ * @since 11.8RC1 */ @ComponentTest -public class DisableAccountFailureStrategyTest +class DisableAccountFailureStrategyTest { @InjectMockComponents(role = AuthenticationFailureStrategy.class) private DisableAccountFailureStrategy disableStrategy; @@ -61,7 +60,7 @@ public class DisableAccountFailureStrategyTest private XWikiDocument updatedDocument; @BeforeEach - public void configure() throws XWikiException + public void configure() { DocumentReference documentReference = new DocumentReference("test", "Some", "Page"); @@ -81,7 +80,7 @@ public void configure() throws XWikiException } @Test - public void resetAuthenticationFailureCounterWhenAccountIsActivated() + void resetAuthenticationFailureCounterWhenAccountIsActivated() { when(this.updatedDocument.getOriginalDocument().getXObject(DisableAccountFailureStrategy.USER_CLASS_REFERENCE) .getIntValue("active")).thenReturn(0); @@ -95,7 +94,7 @@ public void resetAuthenticationFailureCounterWhenAccountIsActivated() } @Test - public void dontResetAuthenticationFailureCounterWhenAccountRemainsInactive() + void dontResetAuthenticationFailureCounterWhenAccountRemainsInactive() { when(this.updatedDocument.getOriginalDocument().getXObject(DisableAccountFailureStrategy.USER_CLASS_REFERENCE) .getIntValue("active")).thenReturn(0); @@ -109,7 +108,7 @@ public void dontResetAuthenticationFailureCounterWhenAccountRemainsInactive() } @Test - public void dontResetAuthenticationFailureCounterWhenAccountRemainsActive() + void dontResetAuthenticationFailureCounterWhenAccountRemainsActive() { when(this.updatedDocument.getOriginalDocument().getXObject(DisableAccountFailureStrategy.USER_CLASS_REFERENCE) .getIntValue("active")).thenReturn(1); @@ -123,7 +122,7 @@ public void dontResetAuthenticationFailureCounterWhenAccountRemainsActive() } @Test - public void dontResetAuthenticationFailureCounterWhenAccountIsDeactivated() + void dontResetAuthenticationFailureCounterWhenAccountIsDeactivated() { when(this.updatedDocument.getOriginalDocument().getXObject(DisableAccountFailureStrategy.USER_CLASS_REFERENCE) .getIntValue("active")).thenReturn(1); @@ -137,7 +136,7 @@ public void dontResetAuthenticationFailureCounterWhenAccountIsDeactivated() } @Test - public void onDocumentUpdatedNoUserAccount() + void onDocumentUpdatedNoUserAccount() { when(this.updatedDocument.getXObject(DisableAccountFailureStrategy.USER_CLASS_REFERENCE)).thenReturn(null); @@ -147,7 +146,7 @@ public void onDocumentUpdatedNoUserAccount() } @Test - public void onDocumentUpdatedNoUserAccountStateChange() + void onDocumentUpdatedNoUserAccountStateChange() { disableStrategy.onEvent(new DocumentUpdatedEvent(), updatedDocument, null); @@ -155,8 +154,8 @@ public void onDocumentUpdatedNoUserAccountStateChange() } @Test - public void validateFormReturnsFalseWhenUserNotFound() + void validateFormReturnsFalseWhenUserNotFound() { - assertFalse(this.disableStrategy.validateForm("Foo", null)); + assertFalse(this.disableStrategy.validateForm("Foo", (javax.servlet.http.HttpServletRequest) null)); } } diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-script/pom.xml b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-script/pom.xml index d1be49fa49c4..8d1b9bc63368 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-script/pom.xml +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-authentication/xwiki-platform-security-authentication-script/pom.xml @@ -62,8 +62,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-requiredrights/xwiki-platform-security-requiredrights-default/pom.xml b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-requiredrights/xwiki-platform-security-requiredrights-default/pom.xml index a3dc5b03e5a4..181a2acb3ae0 100644 --- a/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-requiredrights/xwiki-platform-security-requiredrights-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-security/xwiki-platform-security-requiredrights/xwiki-platform-security-requiredrights-default/pom.xml @@ -57,6 +57,8 @@ xwiki-platform-rendering-macro-script ${project.version} + + org.xwiki.platform xwiki-platform-test-oldcore diff --git a/xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/pom.xml b/xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/pom.xml index 2c655841aeb0..fcaafd99a91c 100644 --- a/xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/pom.xml +++ b/xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-skinx/pom.xml @@ -41,8 +41,8 @@ aspectjrt - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/pom.xml b/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/pom.xml index 7f102902c63b..b277333a12d2 100644 --- a/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/pom.xml +++ b/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/pom.xml @@ -99,8 +99,8 @@ ${commons.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/main/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManager.java b/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/main/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManager.java index 2279a858b089..3619ed1e139c 100644 --- a/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/main/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManager.java +++ b/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/main/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManager.java @@ -27,15 +27,15 @@ import javax.inject.Inject; import javax.inject.Provider; import javax.inject.Singleton; -import javax.servlet.http.HttpSession; -import javax.servlet.http.Part; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; import org.xwiki.attachment.validation.AttachmentValidationException; import org.xwiki.attachment.validation.AttachmentValidator; import org.xwiki.component.annotation.Component; +import org.xwiki.container.Container; +import org.xwiki.container.servlet.ServletSession; import org.xwiki.internal.attachment.XWikiAttachmentAccessWrapper; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; import org.xwiki.model.reference.DocumentReference; import org.xwiki.store.TemporaryAttachmentException; import org.xwiki.store.TemporaryAttachmentSessionsManager; @@ -44,6 +44,9 @@ import com.xpn.xwiki.doc.XWikiAttachment; import com.xpn.xwiki.doc.XWikiDocument; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.Part; + /** * Default implementation of {@link TemporaryAttachmentSessionsManager}. * @@ -63,12 +66,11 @@ public class DefaultTemporaryAttachmentSessionsManager implements TemporaryAttac private Provider attachmentValidator; @Inject - private Logger logger; + private Provider container; private HttpSession getSession() { - XWikiContext context = this.contextProvider.get(); - return context.getRequest().getSession(); + return ((ServletSession) this.container.get().getSession()).getJakartaHttpSession(); } private TemporaryAttachmentSession getOrCreateSession() @@ -90,6 +92,14 @@ public XWikiAttachment uploadAttachment(DocumentReference documentReference, Par return uploadAttachment(documentReference, part, null); } + @Override + @Deprecated + public XWikiAttachment uploadAttachment(DocumentReference documentReference, javax.servlet.http.Part part, + String filename) throws TemporaryAttachmentException, AttachmentValidationException + { + return uploadAttachment(documentReference, JakartaServletBridge.toJakarta(part), filename); + } + @Override public XWikiAttachment uploadAttachment(DocumentReference documentReference, Part part, String filename) throws TemporaryAttachmentException, AttachmentValidationException @@ -107,7 +117,7 @@ public XWikiAttachment uploadAttachment(DocumentReference documentReference, Par xWikiAttachment.setFilename(actualFilename); xWikiAttachment.setContent(part.getInputStream()); xWikiAttachment.setAuthorReference(context.getUserReference()); - // Initialize an empty document with the right document reference and locale. We don't set the actual + // Initialize an empty document with the right document reference and locale. We don't set the actual // document since it's a temporary attachment, but it is still useful to have a minimal knowledge of the // document it is stored for. xWikiAttachment.setDoc(new XWikiDocument(documentReference, documentReference.getLocale()), false); diff --git a/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/test/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManagerTest.java b/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/test/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManagerTest.java index dbc7d1d46da8..2b1e5152d669 100644 --- a/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/test/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManagerTest.java +++ b/xwiki-platform-core/xwiki-platform-store/xwiki-platform-store-filesystem-oldcore/src/test/java/org/xwiki/store/filesystem/internal/DefaultTemporaryAttachmentSessionsManagerTest.java @@ -19,8 +19,23 @@ */ package org.xwiki.store.filesystem.internal; +import static com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.UPLOAD_MAXSIZE_PARAMETER; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; + import java.io.ByteArrayInputStream; -import java.io.File; import java.io.InputStream; import java.util.Arrays; import java.util.Collections; @@ -28,7 +43,6 @@ import java.util.Optional; import javax.inject.Provider; -import javax.servlet.http.HttpSession; import javax.servlet.http.Part; import org.junit.jupiter.api.BeforeEach; @@ -39,11 +53,13 @@ import org.mockito.Mock; import org.xwiki.attachment.validation.AttachmentValidationException; import org.xwiki.attachment.validation.AttachmentValidator; -import org.xwiki.environment.Environment; +import org.xwiki.container.Container; +import org.xwiki.container.servlet.ServletSession; import org.xwiki.model.reference.DocumentReference; import org.xwiki.model.reference.SpaceReference; import org.xwiki.store.TemporaryAttachmentException; -import org.xwiki.test.junit5.XWikiTempDir; +import org.xwiki.test.TestEnvironment; +import org.xwiki.test.annotation.ComponentList; import org.xwiki.test.junit5.mockito.ComponentTest; import org.xwiki.test.junit5.mockito.InjectMockComponents; import org.xwiki.test.junit5.mockito.MockComponent; @@ -54,23 +70,8 @@ import com.xpn.xwiki.doc.XWikiAttachment; import com.xpn.xwiki.doc.XWikiDocument; import com.xpn.xwiki.web.Utils; -import com.xpn.xwiki.web.XWikiRequest; -import static com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.UPLOAD_MAXSIZE_PARAMETER; -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doThrow; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; +import jakarta.servlet.http.HttpSession; /** * Tests for {@link DefaultTemporaryAttachmentSessionsManager}. @@ -79,6 +80,7 @@ * @since 14.3RC1 */ @ComponentTest +@ComponentList(TestEnvironment.class) class DefaultTemporaryAttachmentSessionsManagerTest { private static final String ATTRIBUTE_KEY = "xwikiTemporaryAttachments"; @@ -92,12 +94,12 @@ class DefaultTemporaryAttachmentSessionsManagerTest @MockComponent private Provider attachmentValidatorProvider; + @MockComponent + private Container container; + @Mock private AttachmentValidator attachmentValidator; - @XWikiTempDir - private File tmpDir; - @Mock private XWikiContext context; @@ -109,14 +111,11 @@ void setup(MockitoComponentManager mockitoComponentManager) throws Exception { when(this.contextProvider.get()).thenReturn(this.context); - XWikiRequest xWikiRequest = mock(XWikiRequest.class); - when(xWikiRequest.getSession()).thenReturn(this.httpSession); - when(this.context.getRequest()).thenReturn(xWikiRequest); + ServletSession session = mock(ServletSession.class); + when(session.getJakartaHttpSession()).thenReturn(this.httpSession); + when(this.container.getSession()).thenReturn(session); Utils.setComponentManager(mockitoComponentManager); - Environment environment = mockitoComponentManager.registerMockComponent(Environment.class); - when(environment.getTemporaryDirectory()).thenReturn(this.tmpDir); - when(this.attachmentValidatorProvider.get()).thenReturn(this.attachmentValidator); } diff --git a/xwiki-platform-core/xwiki-platform-tag/xwiki-platform-tag-api/pom.xml b/xwiki-platform-core/xwiki-platform-tag/xwiki-platform-tag-api/pom.xml index 318793c6abc6..8cf8cfe559a4 100644 --- a/xwiki-platform-core/xwiki-platform-tag/xwiki-platform-tag-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-tag/xwiki-platform-tag-api/pom.xml @@ -65,10 +65,5 @@ ${commons.version} test - - javax.servlet - javax.servlet-api - test - diff --git a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/pom.xml b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/pom.xml index 426652680ebf..d619a0a1b0fe 100644 --- a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/pom.xml +++ b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-docker/pom.xml @@ -165,8 +165,8 @@ commons-httpclient - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api compile diff --git a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/pom.xml b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/pom.xml index 46deff900827..1edf72055fe8 100644 --- a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/pom.xml +++ b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-integration/pom.xml @@ -79,8 +79,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-oldcore/pom.xml b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-oldcore/pom.xml index 4a785d6ea5f3..275280cc74ca 100644 --- a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-oldcore/pom.xml +++ b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-oldcore/pom.xml @@ -49,8 +49,8 @@ test-jar - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api compile diff --git a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/pom.xml b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/pom.xml index 56af5cfa7f17..ae1d9d2df691 100644 --- a/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/pom.xml +++ b/xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-page/pom.xml @@ -108,6 +108,10 @@ xwiki-platform-rendering-transformation-macro ${project.version} + + jakarta.servlet + jakarta.servlet-api + org.jsoup jsoup diff --git a/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-container/pom.xml b/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-container/pom.xml index 25c3035fdeee..5dfb35c4ba5e 100644 --- a/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-container/pom.xml +++ b/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-container/pom.xml @@ -75,8 +75,8 @@ commons-lang3 - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-default/pom.xml b/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-default/pom.xml index 5ef02af08177..dcaa41c91624 100644 --- a/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-default/pom.xml @@ -54,8 +54,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-schemes/xwiki-platform-url-scheme-standard/pom.xml b/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-schemes/xwiki-platform-url-scheme-standard/pom.xml index 5a7e4772419c..1ad3ecb5b080 100644 --- a/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-schemes/xwiki-platform-url-scheme-standard/pom.xml +++ b/xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-schemes/xwiki-platform-url-scheme-standard/pom.xml @@ -65,8 +65,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-default/pom.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-default/pom.xml index 964bc21f8027..2f1a18409570 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-default/pom.xml @@ -64,6 +64,7 @@ xwiki-platform-configuration-default ${project.version} + org.xwiki.platform diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-resource/pom.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-resource/pom.xml index b20f036b46c0..dd70977fa75c 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-resource/pom.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-resource/pom.xml @@ -59,8 +59,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-velocity/xwiki-platform-velocity-webapp/pom.xml b/xwiki-platform-core/xwiki-platform-velocity/xwiki-platform-velocity-webapp/pom.xml index 46b5d29e7d49..e4cca021a68e 100644 --- a/xwiki-platform-core/xwiki-platform-velocity/xwiki-platform-velocity-webapp/pom.xml +++ b/xwiki-platform-core/xwiki-platform-velocity/xwiki-platform-velocity-webapp/pom.xml @@ -46,8 +46,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-vfs/xwiki-platform-vfs-api/pom.xml b/xwiki-platform-core/xwiki-platform-vfs/xwiki-platform-vfs-api/pom.xml index c06873616707..685a755b1e35 100644 --- a/xwiki-platform-core/xwiki-platform-vfs/xwiki-platform-vfs-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-vfs/xwiki-platform-vfs-api/pom.xml @@ -223,8 +223,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/WEB-INF/jetty-web.xml b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/WEB-INF/jetty-web.xml index 489e4a8e6d2d..474918d675ad 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/WEB-INF/jetty-web.xml +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/WEB-INF/jetty-web.xml @@ -1,5 +1,5 @@ - + - + - ConversionFilter + HTMLConversionFilter org.xwiki.wysiwyg.filter.ConversionFilter @@ -101,13 +101,13 @@ XWikiContextInitializationFilter - com.xpn.xwiki.web.XWikiContextInitializationFilter + com.xpn.xwiki.web.XWikiContextInitializer XWikiRESTContextInitializationFilter - com.xpn.xwiki.web.XWikiContextInitializationFilter + com.xpn.xwiki.web.XWikiContextInitializer mode @@ -177,7 +177,7 @@ - ConversionFilter + HTMLConversionFilter action REQUEST INCLUDE @@ -226,7 +226,7 @@ - org.xwiki.container.servlet.XWikiServletContextListener + org.xwiki.container.servlet.XWikiServletContextInitializer diff --git a/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/pom.xml b/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/pom.xml index 3593056ac346..3cf58f5248e9 100644 --- a/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/pom.xml @@ -99,8 +99,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/src/test/java/org/xwiki/webjars/internal/WebJarsResourceReferenceHandlerTest.java b/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/src/test/java/org/xwiki/webjars/internal/WebJarsResourceReferenceHandlerTest.java index 33ccf91b7342..711d6ab97ccc 100644 --- a/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/src/test/java/org/xwiki/webjars/internal/WebJarsResourceReferenceHandlerTest.java +++ b/xwiki-platform-core/xwiki-platform-webjars/xwiki-platform-webjars-api/src/test/java/org/xwiki/webjars/internal/WebJarsResourceReferenceHandlerTest.java @@ -19,6 +19,23 @@ */ package org.xwiki.webjars.internal; +import static ch.qos.logback.classic.Level.ERROR; +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; +import static org.xwiki.test.LogLevel.DEBUG; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -26,8 +43,6 @@ import java.util.Date; import javax.inject.Named; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.apache.commons.io.input.CharSequenceInputStream; import org.apache.velocity.exception.VelocityException; @@ -49,22 +64,8 @@ import org.xwiki.test.junit5.mockito.MockComponent; import org.xwiki.webjars.internal.filter.WebJarsResourceFilter; -import static ch.qos.logback.classic.Level.ERROR; -import static java.util.Arrays.asList; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotSame; -import static org.junit.jupiter.api.Assertions.assertSame; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoInteractions; -import static org.mockito.Mockito.when; -import static org.xwiki.test.LogLevel.DEBUG; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * Unit tests for {@link WebJarsResourceReferenceHandler}. @@ -114,11 +115,11 @@ void setUp() throws Exception when(this.response.getOutputStream()).thenReturn(responseOutputStream); HttpServletResponse httpResponse = mock(HttpServletResponse.class); - when(this.response.getHttpServletResponse()).thenReturn(httpResponse); + when(this.response.getJakartaHttpServletResponse()).thenReturn(httpResponse); when(this.container.getResponse()).thenReturn(this.response); HttpServletRequest httpRequest = mock(HttpServletRequest.class); - when(this.request.getHttpServletRequest()).thenReturn(httpRequest); + when(this.request.getJakartaHttpServletRequest()).thenReturn(httpRequest); when(this.container.getRequest()).thenReturn(this.request); when(this.classLoaderManager.getURLClassLoader("wiki:wiki", true)).thenReturn(this.classLoader); @@ -133,8 +134,8 @@ void executeWhenResourceDoesntExist() throws Exception this.handler.handle(reference, this.chain); verify(this.classLoader).getResourceAsStream("META-INF/resources/webjars/angular/2.1.11/angular.js"); - verify(this.response.getHttpServletResponse()) - .sendError(404, "Resource not found [angular/2.1.11/angular.js]."); + verify(this.response.getJakartaHttpServletResponse()).sendError(404, + "Resource not found [angular/2.1.11/angular.js]."); verify(this.chain).handleNext(reference); } @@ -145,8 +146,8 @@ void executeWhenResourceExists() throws Exception new WebJarsResourceReference("wiki:wiki", asList("angular", "2.1.11", "angular.js")); ByteArrayInputStream resourceStream = new ByteArrayInputStream("content".getBytes()); - when(this.classLoader.getResourceAsStream("META-INF/resources/webjars/angular/2.1.11/angular.js")).thenReturn( - resourceStream); + when(this.classLoader.getResourceAsStream("META-INF/resources/webjars/angular/2.1.11/angular.js")) + .thenReturn(resourceStream); long now = new Date().getTime(); this.handler.handle(reference, this.chain); @@ -160,15 +161,15 @@ void executeWhenResourceExists() throws Exception verify(this.response).setContentType("application/javascript"); // Verify that the static resource is cached permanently. - verify(this.response.getHttpServletResponse()).setHeader("Cache-Control", "public"); + verify(this.response.getJakartaHttpServletResponse()).setHeader("Cache-Control", "public"); ArgumentCaptor expireDate = ArgumentCaptor.forClass(Long.class); - verify(this.response.getHttpServletResponse()).setDateHeader(eq("Expires"), expireDate.capture()); + verify(this.response.getJakartaHttpServletResponse()).setDateHeader(eq("Expires"), expireDate.capture()); // The expiration date should be in one year from now. assertTrue(expireDate.getValue() >= (now + 365 * 24 * 3600 * 1000L)); // Also verify that the "Last-Modified" header has been set in the response so that the browser will send // an If-Modified-Since header for the next request and we can tell it to use its cache. - verify(this.response.getHttpServletResponse()).setDateHeader(eq("Last-Modified"), anyLong()); + verify(this.response.getJakartaHttpServletResponse()).setDateHeader(eq("Last-Modified"), anyLong()); verify(this.chain).handleNext(reference); } @@ -179,12 +180,12 @@ void return304WhenIfModifiedSinceHeader() throws Exception WebJarsResourceReference reference = new WebJarsResourceReference("wiki:wiki", asList("angular", "2.1.11", "angular.js")); - when(this.request.getHttpServletRequest().getHeader("If-Modified-Since")).thenReturn("some value"); + when(this.request.getJakartaHttpServletRequest().getHeader("If-Modified-Since")).thenReturn("some value"); this.handler.handle(reference, this.chain); // This the test: we verify that 304 is returned when the "If-Modified-Since" header is found in the request - verify(this.response.getHttpServletResponse()).setStatus(304); + verify(this.response.getJakartaHttpServletResponse()).setStatus(304); verify(this.chain).handleNext(reference); } @@ -198,8 +199,7 @@ void evaluateResource() throws Exception try (ByteArrayInputStream resourceStream = new ByteArrayInputStream("content".getBytes())) { when(this.classLoader.getResourceAsStream("META-INF/resources/webjars/angular/2.1.11/angular.js")) - .thenReturn( - resourceStream); + .thenReturn(resourceStream); } when(this.velocityFilter.filter(any(), any())) @@ -214,8 +214,8 @@ void evaluateResource() throws Exception verify(this.response).setContentType("application/javascript"); // Verify that the dynamic resource is not cached. - verify(this.response.getHttpServletResponse(), never()).setHeader(any(), any()); - verify(this.response.getHttpServletResponse(), never()).setDateHeader(any(), anyLong()); + verify(this.response.getJakartaHttpServletResponse(), never()).setHeader(any(), any()); + verify(this.response.getJakartaHttpServletResponse(), never()).setDateHeader(any(), anyLong()); } @Test @@ -243,7 +243,7 @@ void failingResourceEvaluation() throws Exception this.logCapture.getMessage(0)); // Verify that the client is properly notified about the failure. - verify(this.response.getHttpServletResponse()).sendError(500, + verify(this.response.getJakartaHttpServletResponse()).sendError(500, "Failed to evaluate the Velocity code from WebJar resource [angular/2.1.11/angular.js]"); // The next handlers are still called. @@ -284,9 +284,8 @@ void getContentType() throws Exception WebJarsResourceReference resourceReference = new WebJarsResourceReference("testNamespace", asList("testdirectory", "testfile.less")); - String mimeType = - this.handler.getContentType(new CharSequenceInputStream("a:\n color: #f00;", StandardCharsets.UTF_8), - resourceReference); + String mimeType = this.handler.getContentType( + new CharSequenceInputStream("a:\n color: #f00;", StandardCharsets.UTF_8), resourceReference); assertEquals("text/x-less", mimeType); } @@ -297,9 +296,8 @@ void getContentTypeLessAndEvaluate() throws Exception new WebJarsResourceReference("testNamespace", asList("testdirectory", "testfile.less")); resourceReference.addParameter("evaluate", "true"); - String mimeType = - this.handler.getContentType(new CharSequenceInputStream("a:\n color: #f00;", StandardCharsets.UTF_8), - resourceReference); + String mimeType = this.handler.getContentType( + new CharSequenceInputStream("a:\n color: #f00;", StandardCharsets.UTF_8), resourceReference); assertEquals("text/css", mimeType); } diff --git a/xwiki-platform-core/xwiki-platform-websocket/pom.xml b/xwiki-platform-core/xwiki-platform-websocket/pom.xml index d0152cfb12fb..b06b68c44624 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/pom.xml +++ b/xwiki-platform-core/xwiki-platform-websocket/pom.xml @@ -48,12 +48,16 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api - javax.websocket - javax.websocket-api + jakarta.websocket + jakarta.websocket-api + + + jakarta.websocket + jakarta.websocket-client-api diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/AbstractXWikiEndpoint.java b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/AbstractXWikiEndpoint.java index af8cee9fc621..30db06d8117f 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/AbstractXWikiEndpoint.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/AbstractXWikiEndpoint.java @@ -26,10 +26,10 @@ import java.util.List; import javax.inject.Inject; -import javax.websocket.CloseReason; -import javax.websocket.EncodeException; -import javax.websocket.Endpoint; -import javax.websocket.Session; +import jakarta.websocket.CloseReason; +import jakarta.websocket.EncodeException; +import jakarta.websocket.Endpoint; +import jakarta.websocket.Session; import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DefaultWebSocketContext.java b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DefaultWebSocketContext.java index 767e51efea53..c4f0ec29207c 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DefaultWebSocketContext.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DefaultWebSocketContext.java @@ -25,10 +25,10 @@ import javax.inject.Inject; import javax.inject.Singleton; -import javax.websocket.HandshakeResponse; -import javax.websocket.Session; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.Session; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpointConfig; import org.slf4j.Logger; import org.xwiki.component.annotation.Component; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DynamicEchoEndpoint.java b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DynamicEchoEndpoint.java index 9db5a523f5a8..5ce9bafb44d3 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DynamicEchoEndpoint.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/DynamicEchoEndpoint.java @@ -22,10 +22,10 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.MessageHandler; -import javax.websocket.Session; +import jakarta.websocket.CloseReason; +import jakarta.websocket.EndpointConfig; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.Session; import org.xwiki.bridge.DocumentAccessBridge; import org.xwiki.component.annotation.Component; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/StaticEchoEndpoint.java b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/StaticEchoEndpoint.java index d25f5e935a3e..240ebf4d4875 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/StaticEchoEndpoint.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/StaticEchoEndpoint.java @@ -24,11 +24,11 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import javax.websocket.CloseReason; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; +import jakarta.websocket.CloseReason; +import jakarta.websocket.OnMessage; +import jakarta.websocket.OnOpen; +import jakarta.websocket.Session; +import jakarta.websocket.server.ServerEndpoint; import org.slf4j.Logger; import org.xwiki.bridge.DocumentAccessBridge; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStub.java b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStub.java index aa6148f633ba..be90b3ced676 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStub.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStub.java @@ -34,7 +34,7 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpSession; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.server.HandshakeRequest; import com.xpn.xwiki.web.XWikiRequest; import com.xpn.xwiki.web.XWikiServletRequestStub; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStub.java b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStub.java index 1581c6e8ede8..24888aaa1f71 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStub.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/main/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStub.java @@ -33,7 +33,7 @@ import java.util.stream.Collectors; import javax.servlet.http.Cookie; -import javax.websocket.HandshakeResponse; +import jakarta.websocket.HandshakeResponse; import org.apache.commons.lang3.StringUtils; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DefaultWebSocketContextTest.java b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DefaultWebSocketContextTest.java index ecb65ddffa8f..6cf514548358 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DefaultWebSocketContextTest.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DefaultWebSocketContextTest.java @@ -25,10 +25,10 @@ import java.util.Map; import javax.servlet.http.HttpSession; -import javax.websocket.HandshakeResponse; -import javax.websocket.Session; -import javax.websocket.server.HandshakeRequest; -import javax.websocket.server.ServerEndpointConfig; +import jakarta.websocket.HandshakeResponse; +import jakarta.websocket.Session; +import jakarta.websocket.server.HandshakeRequest; +import jakarta.websocket.server.ServerEndpointConfig; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DynamicEchoEndpointTest.java b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DynamicEchoEndpointTest.java index e3b6a08bde71..df9831a14d3d 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DynamicEchoEndpointTest.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/DynamicEchoEndpointTest.java @@ -19,10 +19,10 @@ */ package org.xwiki.websocket.internal; -import javax.websocket.CloseReason; -import javax.websocket.MessageHandler; -import javax.websocket.RemoteEndpoint.Basic; -import javax.websocket.Session; +import jakarta.websocket.CloseReason; +import jakarta.websocket.MessageHandler; +import jakarta.websocket.RemoteEndpoint.Basic; +import jakarta.websocket.Session; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStubTest.java b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStubTest.java index 2e3182d1f469..51ec3e81c240 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStubTest.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketRequestStubTest.java @@ -28,7 +28,7 @@ import java.util.Map; import javax.servlet.http.HttpSession; -import javax.websocket.server.HandshakeRequest; +import jakarta.websocket.server.HandshakeRequest; import org.junit.jupiter.api.Test; diff --git a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStubTest.java b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStubTest.java index afee2e62b06e..d65903d81d9e 100644 --- a/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStubTest.java +++ b/xwiki-platform-core/xwiki-platform-websocket/src/test/java/org/xwiki/websocket/internal/XWikiWebSocketResponseStubTest.java @@ -27,7 +27,7 @@ import java.util.Map; import javax.servlet.http.Cookie; -import javax.websocket.HandshakeResponse; +import jakarta.websocket.HandshakeResponse; import org.junit.jupiter.api.Test; diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-creationjob/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-creationjob/pom.xml index 1d8b92d43185..fa8b7ea152b8 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-creationjob/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-creationjob/pom.xml @@ -92,8 +92,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-default/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-default/pom.xml index cf020b055621..e04d4a3688d2 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-default/pom.xml @@ -76,8 +76,8 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-script/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-script/pom.xml index c00e8807d371..2ac1a8a065c0 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-script/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-script/pom.xml @@ -65,8 +65,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-default/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-default/pom.xml index bf02c28a00f3..e09c996df0e8 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-default/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-default/pom.xml @@ -53,8 +53,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-script/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-script/pom.xml index c61f0213bfd7..2c9dc9b579cd 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-script/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-template/xwiki-platform-wiki-template-script/pom.xml @@ -50,8 +50,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-user/xwiki-platform-wiki-user-script/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-user/xwiki-platform-wiki-user-script/pom.xml index ca8f2e4431d3..6b5fdbded652 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-user/xwiki-platform-wiki-user-script/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-user/xwiki-platform-wiki-user-script/pom.xml @@ -53,8 +53,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-workspaces-migrator/pom.xml b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-workspaces-migrator/pom.xml index e9acd5c50f73..66cff3ebcb91 100644 --- a/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-workspaces-migrator/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wiki/xwiki-platform-wiki-workspaces-migrator/pom.xml @@ -53,8 +53,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/pom.xml b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/pom.xml index ee3da6e43f7a..c67c0aa3513e 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/pom.xml +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/pom.xml @@ -37,9 +37,9 @@ WYSIWYG Editor Module - - javax.servlet - javax.servlet-api + + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/JakartaRequestParameterConversionResult.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/JakartaRequestParameterConversionResult.java new file mode 100644 index 000000000000..319e8b02806c --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/JakartaRequestParameterConversionResult.java @@ -0,0 +1,78 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.wysiwyg.converter; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.xwiki.wysiwyg.filter.MutableJakartaServletRequest; + +/** + * Simple POJO holding the result of a conversion performed with {@link RequestParameterConverter}. More specifically + * this class contains a mutable request, resulting of the conversion, a map of errors that might have occurred during + * the conversion for each parameter, and a map of the output of the conversion for each parameter. + * + * @version $Id$ + * @since 42.0.0 + */ +public class JakartaRequestParameterConversionResult +{ + private MutableJakartaServletRequest request; + + private Map errors; + + private Map output; + + /** + * Default constructor. + * + * @param request a mutable copy of the original request used for the conversion + */ + public JakartaRequestParameterConversionResult(MutableJakartaServletRequest request) + { + this.request = request; + this.errors = new LinkedHashMap<>(); + this.output = new LinkedHashMap<>(); + } + + /** + * @return the mutable request + */ + public MutableJakartaServletRequest getRequest() + { + return request; + } + + /** + * @return the map of errors indexed by parameters + */ + public Map getErrors() + { + return errors; + } + + /** + * @return the map of conversion output indexed by parameters + */ + public Map getOutput() + { + return output; + } +} diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConversionResult.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConversionResult.java index f81bb6c53ebd..8672b6a31659 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConversionResult.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConversionResult.java @@ -23,19 +23,24 @@ import java.util.Map; import org.xwiki.wysiwyg.filter.MutableServletRequest; +import org.xwiki.wysiwyg.internal.filter.http.JavaxToJakartaMutableHttpServletRequest; /** - * Simple POJO holding the result of a conversion performed with {@link RequestParameterConverter}. - * More specifically this class contains a mutable request, resulting of the conversion, a map of errors that might have - * occurred during the conversion for each parameter, and a map of the output of the conversion for each parameter. + * Simple POJO holding the result of a conversion performed with {@link RequestParameterConverter}. More specifically + * this class contains a mutable request, resulting of the conversion, a map of errors that might have occurred during + * the conversion for each parameter, and a map of the output of the conversion for each parameter. * * @version $Id$ * @since 14.10 + * @deprecated use {@link JakartaRequestParameterConversionResult} instead */ +@Deprecated(since = "42.0.0") public class RequestParameterConversionResult { private MutableServletRequest request; + private Map errors; + private Map output; /** @@ -50,6 +55,19 @@ public RequestParameterConversionResult(MutableServletRequest request) this.output = new LinkedHashMap<>(); } + /** + * Default constructor. + * + * @param result the jakarta result to copy + * @since 42.0.0 + */ + public RequestParameterConversionResult(JakartaRequestParameterConversionResult result) + { + this.request = new JavaxToJakartaMutableHttpServletRequest(result.getRequest()); + this.errors = result.getErrors(); + this.output = result.getOutput(); + } + /** * @return the mutable request */ diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConverter.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConverter.java index a7e9910a1ceb..eaa6433a53ba 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConverter.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/converter/RequestParameterConverter.java @@ -22,10 +22,13 @@ import java.io.IOException; import java.util.Optional; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; - import org.xwiki.component.annotation.Role; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; +import org.xwiki.wysiwyg.internal.filter.http.JakartaToJavaxMutableHttpServletRequest; + +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; /** * Check if the given request contains parameters that needs conversion and perform the needing conversion. @@ -37,30 +40,83 @@ public interface RequestParameterConverter { /** - * Check if the given request needs conversion and perform those conversions. - * This method creates a mutable request, modifies and returns it. However in case of - * error it will return an empty optional, and it will handle directly the errors in the response. - * See {@link #convert(ServletRequest)} for using an exception for handling the errors. + * Check if the given request needs conversion and perform those conversions. This method creates a mutable request, + * modifies and returns it. However in case of error it will return an empty optional, and it will handle directly + * the errors in the response. See {@link #convert(javax.servlet.ServletRequest)} for using an exception for + * handling the errors. * * @param request the request that might contain parameter needing conversion or an {@link Optional#empty()} in case - * of error + * of error * @param response the response used to redirect or do changes in case of conversion error * @return a mutable request with the converted parameters, or an empty optional in case of error * @throws IOException in case of problem to write an answer in the response + * @deprecated use {@link #convert(ServletRequest, ServletResponse)} instead */ - Optional convert(ServletRequest request, ServletResponse response) throws IOException; + @Deprecated(since = "42.0.0") + default Optional convert(javax.servlet.ServletRequest request, + javax.servlet.ServletResponse response) throws IOException + { + Optional result = + convert(JakartaServletBridge.toJakarta(request), JakartaServletBridge.toJakarta(response)); + + return result.isEmpty() ? Optional.empty() : Optional.of(JakartaServletBridge.toJavax(result.get())); + } /** - * Check if the given request needs conversion and perform those conversions. - * This method creates a mutable request, modifies it and returns it along with the errors and output that have - * occurred as part of the conversion, all that holds in the returned {@link RequestParameterConversionResult}. - * Consumer of this API should always check if the obtained result contains errors or not to know if the conversion - * properly succeeded. + * Check if the given request needs conversion and perform those conversions. This method creates a mutable request, + * modifies and returns it. However in case of error it will return an empty optional, and it will handle directly + * the errors in the response. See {@link #convert(javax.servlet.ServletRequest)} for using an exception for + * handling the errors. + * + * @param request the request that might contain parameter needing conversion or an {@link Optional#empty()} in case + * of error + * @param response the response used to redirect or do changes in case of conversion error + * @return a mutable request with the converted parameters, or an empty optional in case of error + * @throws IOException in case of problem to write an answer in the response + * @since 42.0.0 + */ + @Unstable + default Optional convert(ServletRequest request, ServletResponse response) throws IOException + { + Optional result = + convert(JakartaServletBridge.toJavax(request), JakartaServletBridge.toJavax(response)); + + return result.isEmpty() ? Optional.empty() : Optional.of(JakartaServletBridge.toJakarta(result.get())); + } + + /** + * Check if the given request needs conversion and perform those conversions. This method creates a mutable request, + * modifies it and returns it along with the errors and output that have occurred as part of the conversion, all + * that holds in the returned {@link RequestParameterConversionResult}. Consumer of this API should always check if + * the obtained result contains errors or not to know if the conversion properly succeeded. * * @param request the request that might contain parameter needing conversion * @return an instance of {@link RequestParameterConversionResult} containing the modified request and the output * and errors that might have occurred * @since 14.10 + * @deprecated use {@link #convert(ServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + default RequestParameterConversionResult convert(javax.servlet.ServletRequest request) + { + return new RequestParameterConversionResult(convert(JakartaServletBridge.toJakarta(request))); + } + + /** + * Check if the given request needs conversion and perform those conversions. This method creates a mutable request, + * modifies it and returns it along with the errors and output that have occurred as part of the conversion, all + * that holds in the returned {@link RequestParameterConversionResult}. Consumer of this API should always check if + * the obtained result contains errors or not to know if the conversion properly succeeded. + * + * @param request the request that might contain parameter needing conversion + * @return an instance of {@link RequestParameterConversionResult} containing the modified request and the output + * and errors that might have occurred + * @since 42.0.0 */ - RequestParameterConversionResult convert(ServletRequest request); + @Unstable + default JakartaRequestParameterConversionResult convert(ServletRequest request) + { + return new JakartaRequestParameterConversionResult( + new JakartaToJavaxMutableHttpServletRequest(convert(JakartaServletBridge.toJavax(request)).getRequest())); + } } diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/ConversionFilter.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/ConversionFilter.java index 995db15d284b..989fc954ac36 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/ConversionFilter.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/ConversionFilter.java @@ -22,12 +22,12 @@ import java.io.IOException; import java.util.Optional; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.xwiki.context.Execution; import org.xwiki.context.ExecutionContext; @@ -38,8 +38,12 @@ /** * This filter is used to convert the values of request parameters that require HTML conversion before being processed. * A HTML editor can use this filter to convert its output to a specific syntax before it is saved. + *

+ * While the class is much older, the since annotation was moved to 42.0.0 because it implement a completely different + * API from Java point of view. * * @version $Id$ + * @since 42.0.0 */ public class ConversionFilter implements Filter { diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableJakartaServletRequest.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableJakartaServletRequest.java new file mode 100644 index 000000000000..8136d84351a0 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableJakartaServletRequest.java @@ -0,0 +1,98 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.wysiwyg.filter; + +import java.io.IOException; + +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; + +/** + * A servlet request that can be modified. It is very useful, for instance, when you need to change the values of some + * request parameters, inside a filter. + * + * @version $Id$ + * @since 42.0.0 + */ +public interface MutableJakartaServletRequest extends ServletRequest +{ + /** + * Sets the value of a request parameter. + * + * @param name the name of the request parameter + * @param value the new value of the request parameter + * @return the old value of the specified request parameter, or {@code null} if this is the first time we set its + * value + */ + String setParameter(String name, String value); + + /** + * Sets the values of a request parameter. + * + * @param name the name of the request parameter + * @param values the new array of values for the specified request parameter + * @return the old values of the specified request parameter, or {@code null} if this is the first time we set its + * values + */ + String[] setParameterValues(String name, String[] values); + + /** + * Removes the request parameter with the specified name. + * + * @param name a string representing the name of the request parameter to be removed + * @return the old value of the specified request parameter, or {@code null} if it wasn't set + */ + String removeParameter(String name); + + /** + * Redirects this request to the specified URL. We had to add this method since there's no generic way to redirect a + * {@link ServletRequest}. + * + * @param response the response object used to redirect + * @param url the location where to redirect + * @throws IOException if the redirect fails + */ + void sendRedirect(ServletResponse response, String url) throws IOException; + + /** + * @return the URL of the requester + */ + String getReferer(); + + /** + * @param attrName the name of the session attribute whose value should be retrieved + * @return the value of the specified session attribute + */ + Object getSessionAttribute(String attrName); + + /** + * Sets the value of a session attribute. + * + * @param attrName the name of the session attribute + * @param attrValue the value to be set + * @return the previous value of the specified session attribute + */ + Object setSessionAttribute(String attrName, Object attrValue); + + /** + * @return the request object wrapped by this object + */ + ServletRequest getRequest(); +} diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequest.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequest.java index c3efb91d4899..8adb847f2b05 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequest.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequest.java @@ -29,7 +29,9 @@ * request parameters, inside a filter. * * @version $Id$ + * @deprecated use {@link MutableJakartaServletRequest} instead */ +@Deprecated(since = "42.0.0") public interface MutableServletRequest extends ServletRequest { /** diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequestFactory.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequestFactory.java index e1db8ec5280d..625e20053249 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequestFactory.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/filter/MutableServletRequestFactory.java @@ -19,9 +19,13 @@ */ package org.xwiki.wysiwyg.filter; -import javax.servlet.ServletRequest; - import org.xwiki.component.annotation.Role; +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.stability.Unstable; +import org.xwiki.wysiwyg.internal.filter.http.JakartaToJavaxMutableHttpServletRequest; +import org.xwiki.wysiwyg.internal.filter.http.JavaxToJakartaMutableHttpServletRequest; + +import jakarta.servlet.ServletRequest; /** * A factory for mutable servlet requests. This factory is needed because concrete mutable servlet requests don't have a @@ -38,6 +42,24 @@ public interface MutableServletRequestFactory * * @param request The original servlet request to wrap. * @return a new mutable servlet request. + * @deprecated use {@link #newInstance(ServletRequest)} instead + */ + @Deprecated(since = "42.0.0") + default MutableServletRequest newInstance(javax.servlet.ServletRequest request) + { + return new JavaxToJakartaMutableHttpServletRequest(newInstance(JakartaServletBridge.toJakarta(request))); + } + + /** + * Creates a new mutable servlet request. + * + * @param request The original servlet request to wrap. + * @return a new mutable servlet request. + * @since 42.0.0 */ - MutableServletRequest newInstance(ServletRequest request); + @Unstable + default MutableJakartaServletRequest newInstance(ServletRequest request) + { + return new JakartaToJavaxMutableHttpServletRequest(newInstance(JakartaServletBridge.toJavax(request))); + } } diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/converter/DefaultRequestParameterConverter.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/converter/DefaultRequestParameterConverter.java index c1c593942aff..c7fe301908dc 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/converter/DefaultRequestParameterConverter.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/converter/DefaultRequestParameterConverter.java @@ -26,21 +26,22 @@ import javax.inject.Inject; import javax.inject.Singleton; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.xwiki.component.annotation.Component; import org.xwiki.wysiwyg.converter.HTMLConverter; -import org.xwiki.wysiwyg.converter.RequestParameterConversionResult; +import org.xwiki.wysiwyg.converter.JakartaRequestParameterConversionResult; import org.xwiki.wysiwyg.converter.RequestParameterConverter; -import org.xwiki.wysiwyg.filter.MutableServletRequest; +import org.xwiki.wysiwyg.filter.MutableJakartaServletRequest; import org.xwiki.wysiwyg.filter.MutableServletRequestFactory; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + /** * Default implementation of {@link RequestParameterConverter} that handles HTML conversion of parameters needing such * conversion. @@ -87,22 +88,25 @@ public class DefaultRequestParameterConverter implements RequestParameterConvert @Override public Optional convert(ServletRequest request, ServletResponse response) throws IOException { - RequestParameterConversionResult conversionResult = this.convert(request); + JakartaRequestParameterConversionResult conversionResult = convert(request); Optional result; if (conversionResult.getErrors().isEmpty()) { result = Optional.of(conversionResult.getRequest()); } else { result = Optional.empty(); - this.handleConversionErrors(conversionResult, response); + handleConversionErrors(conversionResult, response); } + return result; } @Override - public RequestParameterConversionResult convert(ServletRequest request) + public JakartaRequestParameterConversionResult convert(ServletRequest request) { - MutableServletRequest mutableServletRequest = this.mutableServletRequestFactory.newInstance(request); - RequestParameterConversionResult result = new RequestParameterConversionResult(mutableServletRequest); + MutableJakartaServletRequest mutableServletRequest = this.mutableServletRequestFactory.newInstance(request); + JakartaRequestParameterConversionResult result = + new JakartaRequestParameterConversionResult(mutableServletRequest); + // Take the list of request parameters that require HTML conversion. String[] parametersRequiringHTMLConversion = request.getParameterValues(REQUIRES_HTML_CONVERSION); if (parametersRequiringHTMLConversion != null) { @@ -110,13 +114,14 @@ public RequestParameterConversionResult convert(ServletRequest request) result.getRequest().removeParameter(REQUIRES_HTML_CONVERSION); convertHTML(parametersRequiringHTMLConversion, result); } + return result; } private void convertHTML(String[] parametersRequiringHTMLConversion, - RequestParameterConversionResult conversionResult) + JakartaRequestParameterConversionResult conversionResult) { - MutableServletRequest request = conversionResult.getRequest(); + MutableJakartaServletRequest request = conversionResult.getRequest(); for (String parameterName : parametersRequiringHTMLConversion) { String html = request.getParameter(parameterName); // Remove the syntax parameter from the request to avoid interference with further request processing. @@ -135,13 +140,13 @@ private void convertHTML(String[] parametersRequiringHTMLConversion, } } - private void handleConversionErrors(RequestParameterConversionResult conversionResult, ServletResponse res) + private void handleConversionErrors(JakartaRequestParameterConversionResult conversionResult, ServletResponse res) throws IOException { - MutableServletRequest mutableRequest = conversionResult.getRequest(); + MutableJakartaServletRequest mutableRequest = conversionResult.getRequest(); ServletRequest originalRequest = mutableRequest.getRequest(); - if (originalRequest instanceof HttpServletRequest - && "XMLHttpRequest".equals(((HttpServletRequest) originalRequest).getHeader("X-Requested-With"))) { + if (originalRequest instanceof HttpServletRequest httpRequest + && "XMLHttpRequest".equals(httpRequest.getHeader("X-Requested-With"))) { // If this is an AJAX request then we should simply send back the error. StringBuilder errorMessage = new StringBuilder(); // Aggregate all error messages (for all fields that have conversion errors). @@ -184,11 +189,11 @@ private void handleConversionErrors(RequestParameterConversionResult conversionR * {@value #CONVERSION_ERRORS} session attributes */ @SuppressWarnings("unchecked") - private String save(RequestParameterConversionResult conversionResult) + private String save(JakartaRequestParameterConversionResult conversionResult) { // Generate a random key to identify the request. String key = RandomStringUtils.randomAlphanumeric(4); - MutableServletRequest request = conversionResult.getRequest(); + MutableJakartaServletRequest request = conversionResult.getRequest(); // Save the output on the session. Map> conversionOutput = diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/JakartaToJavaxMutableHttpServletRequest.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/JakartaToJavaxMutableHttpServletRequest.java new file mode 100644 index 000000000000..8bfd894cdcc6 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/JakartaToJavaxMutableHttpServletRequest.java @@ -0,0 +1,93 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.wysiwyg.internal.filter.http; + +import java.io.IOException; + +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.jakartabridge.servlet.internal.JakartaToJavaxServletRequest; +import org.xwiki.wysiwyg.filter.MutableJakartaServletRequest; +import org.xwiki.wysiwyg.filter.MutableServletRequest; + +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; + +/** + * @version $Id$ + */ +public class JakartaToJavaxMutableHttpServletRequest extends JakartaToJavaxServletRequest + implements MutableJakartaServletRequest +{ + /** + * @param wrapped + */ + public JakartaToJavaxMutableHttpServletRequest(MutableServletRequest wrapped) + { + super(wrapped); + } + + @Override + public String setParameter(String name, String value) + { + return this.wrapped.setParameter(name, value); + } + + @Override + public String[] setParameterValues(String name, String[] values) + { + return this.wrapped.setParameterValues(name, values); + } + + @Override + public String removeParameter(String name) + { + return this.wrapped.removeParameter(name); + } + + @Override + public void sendRedirect(ServletResponse response, String url) throws IOException + { + this.wrapped.sendRedirect(JakartaServletBridge.toJavax(response), url); + } + + @Override + public String getReferer() + { + return this.wrapped.getReferer(); + } + + @Override + public Object getSessionAttribute(String attrName) + { + return this.wrapped.getSessionAttribute(attrName); + } + + @Override + public Object setSessionAttribute(String attrName, Object attrValue) + { + return this.wrapped.setSessionAttribute(attrName, attrValue); + } + + @Override + public ServletRequest getRequest() + { + return JakartaServletBridge.toJakarta(this.wrapped.getRequest()); + } +} diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/JavaxToJakartaMutableHttpServletRequest.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/JavaxToJakartaMutableHttpServletRequest.java new file mode 100644 index 000000000000..5f31ca009817 --- /dev/null +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/JavaxToJakartaMutableHttpServletRequest.java @@ -0,0 +1,93 @@ +/* + * See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.xwiki.wysiwyg.internal.filter.http; + +import java.io.IOException; + +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.xwiki.jakartabridge.servlet.JakartaServletBridge; +import org.xwiki.jakartabridge.servlet.internal.JavaxToJakartaServletRequest; +import org.xwiki.wysiwyg.filter.MutableJakartaServletRequest; +import org.xwiki.wysiwyg.filter.MutableServletRequest; + +/** + * @version $Id$ + */ +public class JavaxToJakartaMutableHttpServletRequest extends JavaxToJakartaServletRequest + implements MutableServletRequest +{ + /** + * @param wrapped + */ + public JavaxToJakartaMutableHttpServletRequest(MutableJakartaServletRequest wrapped) + { + super(wrapped); + } + + @Override + public String setParameter(String name, String value) + { + return this.wrapped.setParameter(name, value); + } + + @Override + public String[] setParameterValues(String name, String[] values) + { + return this.wrapped.setParameterValues(name, values); + } + + @Override + public String removeParameter(String name) + { + return this.wrapped.removeParameter(name); + } + + @Override + public void sendRedirect(ServletResponse response, String url) throws IOException + { + this.wrapped.sendRedirect(JakartaServletBridge.toJakarta(response), url); + } + + @Override + public String getReferer() + { + return this.wrapped.getReferer(); + } + + @Override + public Object getSessionAttribute(String attrName) + { + return this.wrapped.getSessionAttribute(attrName); + } + + @Override + public Object setSessionAttribute(String attrName, Object attrValue) + { + return this.wrapped.setSessionAttribute(attrName, attrValue); + } + + @Override + public ServletRequest getRequest() + { + return JakartaServletBridge.toJavax(this.wrapped.getRequest()); + } +} diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequestFactory.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequestFactory.java index 8e5338691ccd..a15eedecf938 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequestFactory.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequestFactory.java @@ -19,14 +19,13 @@ */ package org.xwiki.wysiwyg.internal.filter.http; -import javax.inject.Singleton; -import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletRequest; - import org.xwiki.component.annotation.Component; -import org.xwiki.wysiwyg.filter.MutableServletRequest; +import org.xwiki.wysiwyg.filter.MutableJakartaServletRequest; import org.xwiki.wysiwyg.filter.MutableServletRequestFactory; +import jakarta.inject.Singleton; +import jakarta.servlet.http.HttpServletRequest; + /** * {@link MutableServletRequestFactory} implementation for the HTTP protocol. * @@ -37,10 +36,10 @@ public class MutableHttpServletRequestFactory implements MutableServletRequestFactory { @Override - public synchronized MutableServletRequest newInstance(ServletRequest request) + public synchronized MutableJakartaServletRequest newInstance(jakarta.servlet.ServletRequest request) { - if (request instanceof HttpServletRequest) { - return new MutableHttpServletRequest((HttpServletRequest) request); + if (request instanceof HttpServletRequest httpRequest) { + return new MutableJakartaHttpServletRequest(httpRequest); } else { throw new IllegalArgumentException(String.format("Expecting HttpServletRequest, got [%s]!", request)); } diff --git a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequest.java b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableJakartaHttpServletRequest.java similarity index 87% rename from xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequest.java rename to xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableJakartaHttpServletRequest.java index a67bea9dae75..9ead0430ad0a 100644 --- a/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableHttpServletRequest.java +++ b/xwiki-platform-core/xwiki-platform-wysiwyg/xwiki-platform-wysiwyg-api/src/main/java/org/xwiki/wysiwyg/internal/filter/http/MutableJakartaHttpServletRequest.java @@ -25,33 +25,33 @@ import java.util.HashMap; import java.util.Map; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import javax.servlet.http.HttpServletResponse; - +import org.xwiki.wysiwyg.filter.MutableJakartaServletRequest; import org.xwiki.wysiwyg.filter.MutableServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequestWrapper; +import jakarta.servlet.http.HttpServletResponse; + /** * {@link MutableServletRequest} implementation for the HTTP protocol. * * @version $Id$ */ -public class MutableHttpServletRequest extends HttpServletRequestWrapper implements MutableServletRequest +public class MutableJakartaHttpServletRequest extends HttpServletRequestWrapper implements MutableJakartaServletRequest { /** * Parameters used instead of those from the wrapped request. This way exiting request parameters can be overwritten * and also new parameters can be added. */ - private final Map params = new HashMap(); + private final Map params = new HashMap<>(); /** * Wraps the specified request and copies its parameters to {@link #params} where they can be overwritten later. * * @param request The request to be wrapped. */ - @SuppressWarnings("unchecked") - public MutableHttpServletRequest(HttpServletRequest request) + public MutableJakartaHttpServletRequest(HttpServletRequest request) { super(request); diff --git a/xwiki-platform-core/xwiki-platform-zipexplorer/pom.xml b/xwiki-platform-core/xwiki-platform-zipexplorer/pom.xml index 1aaca6bf0aa0..8b93081a9877 100644 --- a/xwiki-platform-core/xwiki-platform-zipexplorer/pom.xml +++ b/xwiki-platform-core/xwiki-platform-zipexplorer/pom.xml @@ -40,9 +40,10 @@ ${project.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api + org.xwiki.platform @@ -51,11 +52,6 @@ pom test - diff --git a/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-data/pom.xml b/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-data/pom.xml index a5d835c036e2..287de83fe90c 100644 --- a/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-data/pom.xml +++ b/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-data/pom.xml @@ -209,13 +209,6 @@ xwiki-platform-notifications-preferences-default ${project.version} - - - javax.servlet - javax.servlet-api - ${servlet.version} - org.mortbay.jasper apache-el diff --git a/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-security/pom.xml b/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-security/pom.xml index 3662c287fd09..91a7aab23990 100644 --- a/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-security/pom.xml +++ b/xwiki-platform-distribution/xwiki-platform-distribution-flavor/xwiki-platform-distribution-flavor-test/xwiki-platform-distribution-flavor-test-security/pom.xml @@ -62,8 +62,8 @@ test - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api test diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/README.md b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/README.md index 49c732b8b242..02229101b6b2 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/README.md +++ b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/README.md @@ -3,9 +3,8 @@ XWiki Jetty Configuration These instructions are useful when upgrading the Jetty version used. -We brought the following changes from the default Jetty files obtained from the Jetty zip file (in `jetty-home`): +We brought the following changes from the default Jetty files obtained from the `org.eclipse.jetty:jetty-home` package: -1. Addition of XWiki license headers to all files 1. Addition of `modules/xwiki.mod`, to group all modules we depend on. 1. Addition of `start.d/xwiki.ini` to configure the following properties: 1. Disable WAR scanning/hot deployment (since we use static deployment, and it speeds up @@ -20,21 +19,6 @@ We brought the following changes from the default Jetty files obtained from the jetty.httpConfig.uriCompliance=RFC3986,AMBIGUOUS_PATH_ENCODING,AMBIGUOUS_EMPTY_SEGMENT,AMBIGUOUS_PATH_SEPARATOR ``` 1. Addition of `etc/jetty-xwiki.xml` to print a message in the console when XWiki is started. -1. Remove support for JSP (since XWiki doesn't use JSPs) by: - 1. Removing the following from `etc/webdefault-ee8.xml`: - ``` - - ... - - ``` - Also remove the `` just below it. - Under `` alors remove the `index.jsp` line. - 1. Keep only the `apache-el-` lib in `modules/ee8-apache-jsp.mod` (i.e. remove the JSP lib references). - We need the EL lib for Hibernate Validator (see XWIKI-19314) -1. Remove alpn (we don't need TLS/SSL for a demo packaging) and http2 support by: - 1. Remove `lib/jetty-alpn-client-${jetty.version}.jar` from `modules/client.mod` - 1. Remove references to the `alpn` and `http2` modules from `modules/https.mod` -1. Addition of `modules/xwiki-logging.mod` to configure logging for XWiki (provides the Jetty `logging` module name) 1. Modification of `etc/console-capture.xml` to send logs to both the console and files. Namely, we wrap: ``` @@ -54,6 +38,5 @@ We brought the following changes from the default Jetty files obtained from the - ``` -1. Note that we don't include all `etc/*.xml` files nor all `modules/*.mod` files since we don't use these extra - features. + ``` +1. We exclude various files we know we don't need in this context to reduce the size of the resulting zip file \ No newline at end of file diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/pom.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/pom.xml index d9f36a2aa513..b15fe557dc49 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/pom.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/pom.xml @@ -32,114 +32,87 @@ pom Packages a Jetty installation - - true - ${jetty.server.version} - ${jetty.server.slf4j.version} + - - org.xwiki.platform - xwiki-platform-tool-jetty-listener - ${project.version} - true - - - - commons-io - commons-io - true - - - org.eclipse.jetty - jetty-server - ${jetty.version} - true - - - org.eclipse.jetty - jetty-xml - ${jetty.version} - true - - - org.eclipse.jetty - jetty-deploy - ${jetty.version} - true - - - org.eclipse.jetty - jetty-start - ${jetty.version} - shaded - true - - - org.eclipse.jetty - jetty-jmx - ${jetty.version} - true - - - org.eclipse.jetty.ee8 - jetty-ee8-annotations - ${jetty.version} - true - org.eclipse.jetty - jetty-plus - ${jetty.version} - true - - - org.eclipse.jetty - jetty-jndi - ${jetty.version} - true - - - org.eclipse.jetty - jetty-slf4j-impl - ${jetty.version} - true - - - org.eclipse.jetty - jetty-client - ${jetty.version} - true - - - - org.eclipse.jetty.ee8.websocket - jetty-ee8-websocket-javax-server - ${jetty.version} - true - - - org.eclipse.jetty.ee8.websocket - jetty-ee8-websocket-javax-client - ${jetty.version} - true + jetty-home + ${jetty.server.version} + zip + + + + * + * + + - - org.mortbay.jasper - apache-el + org.xwiki.platform + xwiki-platform-tool-jetty-listener + ${project.version} true - compile + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + prepare-package + + unpack + + + + + org.eclipse.jetty + jetty-home + ${jetty.server.version} + zip + + + **/*demo*, + **/*demo*/, + + **/*ee8*, + **/*ee8*/, + **/*ee9*, + **/*ee9*/, + + **/*http2*, + **/*http2*/, + + **/*http3*, + **/*http3*/, + + **/*cdi*, + **/*cdi*/, + + **/*jstl*, + **/*jstl*/ + + + + ${project.build.directory} + + + + + + org.apache.maven.plugins maven-assembly-plugin @@ -149,7 +122,7 @@ false - ${basedir}/src/main/assembly/distribution.xml + src/main/assembly/distribution.xml diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/assembly/distribution.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/assembly/distribution.xml index e2536127335e..6d1dfd5817e7 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/assembly/distribution.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/assembly/distribution.xml @@ -26,89 +26,15 @@ zip false - - - - start.jar - /jetty - - org.eclipse.jetty:jetty-start:jar:shaded - - - false - - - /jetty/lib - - org.eclipse.jetty:jetty-start:jar:shaded - - org.xwiki.platform:xwiki-platform-tool-jetty-listener - commons-io:commons-io - - org.ow2.asm:* - jakarta.annotation:jakarta.annotation-api - - org.slf4j:slf4j-api - org.eclipse.jetty:jetty-slf4j-impl - - org.eclipse.jetty.ee8.websocket:* - *:jetty-javax-websocket-api - - org.mortbay.jasper:apache-el - - - false - - - /jetty/lib/ext - - org.xwiki.platform:xwiki-platform-tool-jetty-listener - commons-io:commons-io - - - false - - - /jetty/lib/ee8-annotations - - org.ow2.asm:* - jakarta.annotation:jakarta.annotation-api - - - false - - - /jetty/lib/ee8-websocket - - org.eclipse.jetty.ee8.websocket:* - *:jetty-javax-websocket-api - - - false - - - - /jetty/lib/logging - - org.slf4j:slf4j-api - org.eclipse.jetty:jetty-slf4j-impl - - - false - - - - - /jetty/lib/ee8-apache-jsp - - org.mortbay.jasper:apache-el - - - false - - + + + + ${project.build.directory}/jetty-home-${jetty.server.version} + /jetty/ + 644 + + ${basedir}/src/main/resources @@ -126,10 +52,23 @@ **/*.sh + ${basedir}/src/main/resources/logs /logs + + + + + /jetty/lib/ext + + org.xwiki.platform:xwiki-platform-tool-jetty-listener + + + false + + diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-bytebufferpool.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-bytebufferpool.xml deleted file mode 100644 index dbde985be754..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-bytebufferpool.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-deploy.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-deploy.xml deleted file mode 100644 index 4a9d32146b28..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-deploy.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee-webapp.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee-webapp.xml deleted file mode 100644 index 3b94f5cffb91..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee-webapp.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee8-deploy.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee8-deploy.xml deleted file mode 100644 index 1b3f910a1548..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee8-deploy.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - org.eclipse.jetty.deploy.DeploymentManager - - - - contextHandlerClass - - - - - - - - ee8 - - - - - - - - - - - - - jetty.deploy.defaultsDescriptorPath - jetty.deploy.defaultsDescriptor - - /etc/webdefault-ee8.xml - - - - - - - - - - - .*/jetty-servlet-api-[^/]*\.jar$|.*jakarta.servlet.jsp.jstl-[^/]*\.jar|.*jsp.jstl-[^/]*\.jar - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee8-webapp.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee8-webapp.xml deleted file mode 100644 index 0bd5e05b400d..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ee8-webapp.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http-forwarded.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http-forwarded.xml deleted file mode 100644 index cbb0632d1294..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http-forwarded.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http.xml deleted file mode 100644 index 1cc65d7ef341..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-http.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-https.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-https.xml deleted file mode 100644 index 13f9cd9698d9..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-https.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - http/1.1 - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-jmx.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-jmx.xml deleted file mode 100644 index 290b15494332..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-jmx.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-requestlog.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-requestlog.xml deleted file mode 100644 index d3417016fb34..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-requestlog.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - /yyyy_mm_dd.request.log - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ssl-context.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ssl-context.xml deleted file mode 100644 index 23e527475faf..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ssl-context.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ssl.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ssl.xml deleted file mode 100644 index ffc314cc87b8..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-ssl.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-threadpool.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-threadpool.xml deleted file mode 100644 index b79642525278..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-threadpool.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty.xml deleted file mode 100644 index c8cfd3c9c498..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/sessions/id-manager.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/sessions/id-manager.xml deleted file mode 100644 index a4841e55da73..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/sessions/id-manager.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - node - - - 0 - - - - - - - - - - - - - - - - - - true - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/webdefault-ee8.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/webdefault-ee8.xml deleted file mode 100644 index 214b9f6a3805..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/webdefault-ee8.xml +++ /dev/null @@ -1,414 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - Default web.xml file. - This file is applied to a Web application before its own WEB_INF/web.xml file - - - - - - - - org.eclipse.jetty.ee8.servlet.listener.IntrospectorCleaner - - - - - - - - - - - - - - - - - default - org.eclipse.jetty.ee8.servlet.DefaultServlet - - acceptRanges - true - - - dirAllowed - true - - - welcomeServlets - false - - - redirectWelcome - false - - - maxCacheSize - 256000000 - - - maxCachedFileSize - 200000000 - - - maxCachedFiles - 2048 - - - etags - false - - - useFileMappedBuffer - true - - 0 - - - - default - / - - - - - - - - 30 - - - - - - - - - - - - - - - index.html - index.htm - - - - - - - - ar - ISO-8859-6 - - - be - ISO-8859-5 - - - bg - ISO-8859-5 - - - ca - ISO-8859-1 - - - cs - ISO-8859-2 - - - da - ISO-8859-1 - - - de - ISO-8859-1 - - - el - ISO-8859-7 - - - en - ISO-8859-1 - - - es - ISO-8859-1 - - - et - ISO-8859-1 - - - fi - ISO-8859-1 - - - fr - ISO-8859-1 - - - hr - ISO-8859-2 - - - hu - ISO-8859-2 - - - is - ISO-8859-1 - - - it - ISO-8859-1 - - - iw - ISO-8859-8 - - - ja - Shift_JIS - - - ko - EUC-KR - - - lt - ISO-8859-2 - - - lv - ISO-8859-2 - - - mk - ISO-8859-5 - - - nl - ISO-8859-1 - - - no - ISO-8859-1 - - - pl - ISO-8859-2 - - - pt - ISO-8859-1 - - - ro - ISO-8859-2 - - - ru - ISO-8859-5 - - - sh - ISO-8859-5 - - - sk - ISO-8859-2 - - - sl - ISO-8859-2 - - - sq - ISO-8859-2 - - - sr - ISO-8859-5 - - - sv - ISO-8859-1 - - - tr - ISO-8859-9 - - - uk - ISO-8859-5 - - - zh - GB2312 - - - zh_TW - Big5 - - - - - - - - - Disable TRACE - / - TRACE - - - - - - Enable everything but TRACE - / - TRACE - - - - - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-xwiki.xml b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/xwiki.xml similarity index 100% rename from xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/jetty-xwiki.xml rename to xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/etc/xwiki.xml diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/bytebufferpool.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/bytebufferpool.mod deleted file mode 100644 index 10c542541d88..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/bytebufferpool.mod +++ /dev/null @@ -1,58 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Configures the ByteBufferPool used by ServerConnectors. -The bucket sizes increase linearly. -Use module "bytebufferpool-quadratic" for a pool that holds more coarse sized buffers. - -[depends] -logging - -[xml] -etc/jetty-bytebufferpool.xml - -[ini-template] -## Minimum capacity of a single ByteBuffer. -#jetty.byteBufferPool.minCapacity=0 - -## Maximum capacity of a single ByteBuffer. -## Requests for ByteBuffers larger than this value results -## in the ByteBuffer being allocated but not pooled. -#jetty.byteBufferPool.maxCapacity=65536 - -## Bucket capacity factor. -## ByteBuffers are allocated out of buckets that have -## a capacity that is multiple of this factor. -#jetty.byteBufferPool.factor=4096 - -## Maximum size for each bucket (-1 for unbounded). -#jetty.byteBufferPool.maxBucketSize=-1 - -## Maximum heap memory held idle by the pool (0 for heuristic, -1 for unlimited). -#jetty.byteBufferPool.maxHeapMemory=0 - -## Maximum direct memory held idle by the pool (0 for heuristic, -1 for unlimited). -#jetty.byteBufferPool.maxDirectMemory=0 - -## Whether statistics are enabled. -#jetty.byteBufferPool.statisticsEnabled=false diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/client.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/client.mod deleted file mode 100644 index 900043c9e9c9..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/client.mod +++ /dev/null @@ -1,27 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds the Jetty HTTP client to the server classpath. - -[lib] -lib/jetty-client-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/console-capture.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/console-capture.mod deleted file mode 100644 index fb78cc48564f..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/console-capture.mod +++ /dev/null @@ -1,51 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Redirects the JVM console stderr and stdout to a rolling log file. - -[tags] -logging - -[depends] -logging - -[xml] -etc/console-capture.xml - -[files] -logs/ - -[ini-template] -# tag::documentation[] -## Logging directory (relative to $JETTY_BASE). -# jetty.console-capture.dir=./logs - -## Whether to append to existing file. -# jetty.console-capture.append=true - -## How many days to retain old log files. -# jetty.console-capture.retainDays=90 - -## Timezone ID of the log timestamps, as specified by java.time.ZoneId. -# jetty.console-capture.timezone=GMT -# end::documentation[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/deploy.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/deploy.mod deleted file mode 100644 index 716e9f0629da..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/deploy.mod +++ /dev/null @@ -1,37 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -This module enables web application deployment from the `$JETTY_BASE/webapps` directory. - -[depend] -server - -[lib] -lib/jetty-deploy-${jetty.version}.jar - -[files] -webapps/ - -[xml] -etc/jetty-deploy.xml - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee-webapp.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee-webapp.mod deleted file mode 100644 index 0a664334541f..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee-webapp.mod +++ /dev/null @@ -1,51 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -# tag::description[] -This module provide common configuration of Java Servlet web applications over all environments. -# end::description[] - -[xml] -etc/jetty-ee-webapp.xml - -[lib] -lib/jetty-ee-${jetty.version}.jar - -[ini-template] -# tag::ini-template[] -## Add to the server wide default jars and packages protected or hidden from webapps. -## Protected (aka System) classes cannot be overridden by a webapp. -## Hidden (aka Server) classes cannot be seen by a webapp -## Lists of patterns are comma separated and may be either: -## + a qualified classname e.g. 'com.acme.Foo' -## + a package name e.g. 'net.example.' -## + a jar file e.g. '${jetty.base.uri}/lib/dependency.jar' -## + a directory of jars,resource or classes e.g. '${jetty.base.uri}/resources' -## + A pattern preceded with a '-' is an exclusion, all other patterns are inclusions -## -## The +=, operator appends to a CSV list with a comma as needed. -## -#jetty.server.addProtectedClasses+=,org.example. -#jetty.server.addHiddenClasses+=,org.example. -# end::ini-template[] - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-annotations.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-annotations.mod deleted file mode 100644 index 0e0c0d75d7c8..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-annotations.mod +++ /dev/null @@ -1,47 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables Annotation scanning for deployed web applications. - -[environment] -ee8 - -[depend] -plus -ee8-plus - -[ini] -ee8.asm.version?=9.7 -ee8.jakarta.annotation.api.version?=1.3.5 - -[lib] -lib/jetty-ee8-annotations-${jetty.version}.jar -lib/ee8-annotations/asm-${ee8.asm.version}.jar -lib/ee8-annotations/asm-analysis-${ee8.asm.version}.jar -lib/ee8-annotations/asm-commons-${ee8.asm.version}.jar -lib/ee8-annotations/asm-tree-${ee8.asm.version}.jar -lib/ee8-annotations/jakarta.annotation-api-${ee8.jakarta.annotation.api.version}.jar - -[jpms] -add-modules:org.objectweb.asm - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-apache-jsp.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-apache-jsp.mod deleted file mode 100644 index a9bca961861a..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-apache-jsp.mod +++ /dev/null @@ -1,37 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables use of the apache implementation of JSP. - -[environment] -ee8 - -[depend] -ee8-servlet -ee8-annotations - -[ini] -ee8.jsp.impl.version?=9.0.90 - -[lib] -lib/ee8-apache-jsp/apache-el-${ee8.jsp.impl.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-deploy.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-deploy.mod deleted file mode 100644 index 371d5789183a..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-deploy.mod +++ /dev/null @@ -1,69 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -# tag::description[] -This module enables webapp deployment from the `$JETTY_BASE/webapps` directory. -# end::description[] - -[environment] -ee8 - -[depend] -deploy -ee8-webapp - -[xml] -etc/jetty-ee8-deploy.xml - -[ini-template] -# tag::ini-template[] -## Monitored directory name (relative to $jetty.base) -# jetty.deploy.monitoredDir=webapps - -## Defaults Descriptor for all deployed webapps -# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault-ee8.xml - -## Monitored directory scan period (seconds) -# jetty.deploy.scanInterval=0 - -## Whether to extract *.war files -# jetty.deploy.extractWars=true - -## Whether to give the parent classloader priority -# jetty.deploy.parentLoaderPriority=true - -## Comma separated list of configuration classes to set. -# jetty.deploy.configurationClasses= - -## Pattern to select jars from the container classloader to be scanned (or null to scan no jars) -# jetty.deploy.containerScanJarPattern=.*/jetty-servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$ - -## Pattern to select jars from the container classloader to be scanned (or null to scan all jars). -# jetty.deploy.webInfScanJarPattern= - -## Pattern to exclude discovered ServletContainerInitializers -# jetty.deploy.servletContainerInitializerExclusionPattern= - -## Order of discovered ServletContainerInitializers -# jetty.deploy.servletContainerInitializerOrder= -# end::ini-template[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-jndi.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-jndi.mod deleted file mode 100644 index 9135ddf9f42e..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-jndi.mod +++ /dev/null @@ -1,33 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds the Jetty EE8 JNDI reference factories - -[environment] -ee8 - -[depend] -jndi - -[lib] -lib/jetty-ee8-jndi-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-plus.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-plus.mod deleted file mode 100644 index 9cc1f0d8fb9e..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-plus.mod +++ /dev/null @@ -1,38 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables Servlet 3.1 resource injection. - -[environment] -ee8 - -[depend] -server -jndi -plus -ee8-security -ee8-webapp - -[lib] -lib/jetty-ee8-plus-${jetty.version}.jar -lib/jakarta.transaction-api-1.3.3.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-security.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-security.mod deleted file mode 100644 index b334fae5a064..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-security.mod +++ /dev/null @@ -1,35 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds servlet standard security handling to the classpath. - -[environment] -ee8 - -[depend] -server -security -ee8-servlet - -[lib] -lib/jetty-ee8-security-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-servlet.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-servlet.mod deleted file mode 100644 index 28eaecb54d28..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-servlet.mod +++ /dev/null @@ -1,36 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables standard Servlet handling. - -[environment] -ee8 - -[depend] -server -sessions - -[lib] -lib/jetty-servlet-api-4.0.6.jar -lib/jetty-ee8-nested-${jetty.version}.jar -lib/jetty-ee8-servlet-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-webapp.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-webapp.mod deleted file mode 100644 index 5645f4d3822f..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-webapp.mod +++ /dev/null @@ -1,61 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds support for servlet specification web applications to the server classpath. -Without this, only Jetty-specific handlers may be deployed. - -[environment] -ee8 - -[depend] -ee-webapp -ee8-servlet -ee8-security - -[xml] -etc/jetty-ee8-webapp.xml - -[lib] -lib/jetty-ee8-webapp-${jetty.version}.jar - -[ini-template] -## Add to the environment wide default jars and packages protected or hidden from webapps. -## System (aka Protected) classes cannot be overridden by a webapp. -## Server (aka Hidden) classes cannot be seen by a webapp -## Lists of patterns are comma separated and may be either: -## + a qualified classname e.g. 'com.acme.Foo' -## + a package name e.g. 'net.example.' -## + a jar file e.g. '${jetty.base.uri}/lib/dependency.jar' -## + a directory of jars,resource or classes e.g. '${jetty.base.uri}/resources' -## + A pattern preceded with a '-' is an exclusion, all other patterns are inclusions -## -## The +=, operator appends to a CSV list with a comma as needed. -## -#jetty.webapp.addProtectedClasses+=,org.example. -#jetty.webapp.addHiddenClasses+=,org.example. - -[ini] -contextHandlerClass=org.eclipse.jetty.ee8.webapp.WebAppContext - -[jpms] -add-modules:java.instrument diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-websocket-javax.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-websocket-javax.mod deleted file mode 100644 index 8150285456d2..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-websocket-javax.mod +++ /dev/null @@ -1,44 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enable javax.websocket APIs for deployed web applications. - -[environment] -ee8 - -[tags] -websocket - -[depend] -client -ee8-annotations - -[lib] -lib/jetty-websocket-core-common-${jetty.version}.jar -lib/jetty-websocket-core-client-${jetty.version}.jar -lib/jetty-websocket-core-server-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-servlet-${jetty.version}.jar -lib/ee8-websocket/jetty-javax-websocket-api-1.1.2.jar -lib/ee8-websocket/jetty-ee8-websocket-javax-client-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-javax-common-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-javax-server-${jetty.version}.jar \ No newline at end of file diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-websocket-jetty.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-websocket-jetty.mod deleted file mode 100644 index 73ac3941e0c7..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ee8-websocket-jetty.mod +++ /dev/null @@ -1,42 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enable the Jetty WebSocket API support for deployed web applications. - -[environment] -ee8 - -[tags] -websocket - -[depend] -ee8-annotations - -[lib] -lib/jetty-websocket-core-common-${jetty.version}.jar -lib/jetty-websocket-core-server-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-servlet-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-jetty-api-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-jetty-common-${jetty.version}.jar -lib/ee8-websocket/jetty-ee8-websocket-jetty-server-${jetty.version}.jar - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ext.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ext.mod deleted file mode 100644 index 17a98d590e5f..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ext.mod +++ /dev/null @@ -1,35 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds the jar file from $JETTY_HOME/lib/ext and $JETTY_BASE/lib/ext to the server classpath. - -[tags] -classpath - -[lib] -lib/ext/**.jar - -[files] -lib/ -lib/ext/ - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/http-forwarded.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/http-forwarded.mod deleted file mode 100644 index 63eb39e7d8f2..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/http-forwarded.mod +++ /dev/null @@ -1,78 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables processing of the "Forwarded" HTTP header (and its predecessors "X-Forwarded-*" HTTP headers). -The "Forwarded" HTTP header is added by intermediaries to provide information about the clients. - -[tags] -connector - -[depend] -http - -[xml] -etc/jetty-http-forwarded.xml - -[ini-template] -# tag::documentation[] -### ForwardedRequestCustomizer Configuration - -## Whether to process only the RFC7239 "Forwarded" header. -## "X-Forwarded-*" headers are not processed. -# jetty.httpConfig.forwardedOnly=false - -## Whether the address obtained from "Forwarded: by=" or -## "X-Forwarded-Server" is used in the request authority. -# jetty.httpConfig.forwardedProxyAsAuthority=false - -## Whether the "X-Forwarded-Port" header is used in the request authority, -## or else it is the remote client port. -# jetty.httpConfig.forwardedPortAsAuthority=true - -## The name of the RFC 7239 HTTP header. -# jetty.httpConfig.forwardedHeader=Forwarded - -## The name of the obsolete forwarded host HTTP header. -# jetty.httpConfig.forwardedHostHeader=X-Forwarded-Host - -## The name of the obsolete forwarded server HTTP header. -# jetty.httpConfig.forwardedServerHeader=X-Forwarded-Server - -## The name of the obsolete forwarded scheme HTTP header. -# jetty.httpConfig.forwardedProtoHeader=X-Forwarded-Proto - -## The name of the obsolete forwarded for HTTP header. -# jetty.httpConfig.forwardedForHeader=X-Forwarded-For - -## The name of the obsolete forwarded port HTTP header. -# jetty.httpConfig.forwardedPortHeader=X-Forwarded-Port - -## The name of the obsolete forwarded https HTTP header. -# jetty.httpConfig.forwardedHttpsHeader=X-Proxied-Https - -## The name of the obsolete forwarded SSL session ID HTTP header. -# jetty.httpConfig.forwardedSslSessionIdHeader=Proxy-ssl-id - -## The name of the obsolete forwarded SSL cipher HTTP header. -# jetty.httpConfig.forwardedCipherSuiteHeader=Proxy-auth-cert -# end::documentation[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/http.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/http.mod deleted file mode 100644 index b135a62ab5aa..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/http.mod +++ /dev/null @@ -1,78 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables a clear-text HTTP connector. -By default clear-text HTTP/1.1 is enabled, and clear-text HTTP/2 may be added by enabling the "http2c" module. - -[tags] -connector -http - -[depend] -server - -[xml] -etc/jetty-http.xml - -[ini-template] -# tag::documentation[] -### Clear-Text HTTP Connector Configuration - -## The host/address to bind the connector to. -# jetty.http.host=0.0.0.0 - -## The port the connector listens on. -# jetty.http.port=8080 - -## The connector idle timeout, in milliseconds. -# jetty.http.idleTimeout=30000 - -## The number of acceptors (-1 picks a default value based on number of cores). -# jetty.http.acceptors=1 - -## The number of selectors (-1 picks a default value based on number of cores). -# jetty.http.selectors=-1 - -## The ServerSocketChannel accept queue backlog (0 picks the platform default). -# jetty.http.acceptQueueSize=0 - -## The thread priority delta to give to acceptor threads. -# jetty.http.acceptorPriorityDelta=0 - -## Whether to enable the SO_REUSEADDR socket option. -# jetty.http.reuseAddress=true - -## Whether to enable the SO_REUSEPORT socket option. -# jetty.http.reusePort=false - -## Whether to enable the TCP_NODELAY socket option on accepted sockets. -# jetty.http.acceptedTcpNoDelay=true - -## The SO_RCVBUF socket option to set on accepted sockets. -## A value of -1 indicates that the platform default is used. -# jetty.http.acceptedReceiveBufferSize=-1 - -## The SO_SNDBUF socket option to set on accepted sockets. -## A value of -1 indicates that the platform default is used. -# jetty.http.acceptedSendBufferSize=-1 -# end::documentation[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/https.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/https.mod deleted file mode 100644 index 6a09c385c745..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/https.mod +++ /dev/null @@ -1,40 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds HTTPS protocol support to the TLS(SSL) Connector. - -[tags] -connector -https -http -ssl - -[depend] -ssl - -[after] -http-forwarded - -[xml] -etc/jetty-https.xml - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jmx.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jmx.mod deleted file mode 100644 index aee601f9d41e..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jmx.mod +++ /dev/null @@ -1,35 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -# tag::description[] -This module enables local Java Management Extension (JMX) support for Jetty components. -# end::description[] - -[depend] -server - -[lib] -lib/jetty-jmx-${jetty.version}.jar - -[xml] -etc/jetty-jmx.xml diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jndi.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jndi.mod deleted file mode 100644 index 8870763db9c0..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jndi.mod +++ /dev/null @@ -1,31 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds the Jetty JNDI implementation to the classpath. - -[depend] -plus -server - -[lib] -lib/jetty-jndi-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jvm.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jvm.mod deleted file mode 100644 index 03096bf12007..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/jvm.mod +++ /dev/null @@ -1,47 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Creates an ini template for setting JVM arguments (eg -Xmx ). - -[ini-template] -## JVM Configuration -## If JVM args are include in an ini file then --exec is needed -## to start a new JVM from start.jar with the extra args. -## -## If you wish to avoid an extra JVM running, place JVM args -## on the normal command line and do not use --exec -# --exec -# -Xmx2000m -# -Xmn512m -# -XX:+UseConcMarkSweepGC -# -XX:ParallelCMSThreads=2 -# -XX:+CMSClassUnloadingEnabled -# -XX:+UseCMSCompactAtFullCollection -# -XX:CMSInitiatingOccupancyFraction=80 -# -internal:gc -# -XX:+PrintGCDateStamps -# -XX:+PrintGCTimeStamps -# -XX:+PrintGCDetails -# -XX:+PrintTenuringDistribution -# -XX:+PrintCommandLineFlags -# -XX:+DisableExplicitGC diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/logging/jetty/resources/jetty-logging.properties b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/logging/jetty/resources/jetty-logging.properties deleted file mode 100644 index 17e9bdcf9e21..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/logging/jetty/resources/jetty-logging.properties +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -## Set logging levels from: ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF -org.eclipse.jetty.LEVEL=INFO -## Configure a level for an arbitrary logger tree -#com.example.LEVEL=INFO -## Configure a level for specific logger -#com.example.MyComponent.LEVEL=INFO -## Configure JMX Context Name -# org.eclipse.jetty.logging.jmx.context=JettyServer -## Hide stacks traces in an arbitrary logger tree -#com.example.STACKS=false diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/logging/slf4j.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/logging/slf4j.mod deleted file mode 100644 index f44b6da64ba4..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/logging/slf4j.mod +++ /dev/null @@ -1,39 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Configures logging to use SLF4J. -A specific implementation of SLF4J is not enabled. -If one is not selected then NOP implementation will be used. - -[tags] -logging - -[provides] -slf4j - -[lib] -lib/logging/slf4j-api-${slf4j.version}.jar - -[ini] -slf4j.version?=2.0.13 -jetty.webapp.addHiddenClasses+=,org.slf4j. diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/plus.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/plus.mod deleted file mode 100644 index 45c285e5618b..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/plus.mod +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds the Jetty Plus JNDI support to the classpath. - -[depend] -server - -[lib] -lib/jetty-plus-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/requestlog.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/requestlog.mod deleted file mode 100644 index ace6429c03bb..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/requestlog.mod +++ /dev/null @@ -1,64 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Logs requests using CustomRequestLog and AsyncRequestLogWriter. - -[tags] -requestlog -logging - -[depend] -server - -[xml] -etc/jetty-requestlog.xml - -[files] -logs/ - -[ini] -jetty.requestlog.dir?=logs - -[ini-template] -# tag::documentation[] -## Format string -# jetty.requestlog.formatString=%{client}a - %u %{dd/MMM/yyyy:HH:mm:ss ZZZ|GMT}t "%r" %s %O "%{Referer}i" "%{User-Agent}i" - -## Logging directory (relative to $jetty.base) -# jetty.requestlog.dir=logs - -## File path -# jetty.requestlog.filePath=${jetty.requestlog.dir}/yyyy_mm_dd.request.log - -## Date format for rollovered files (uses SimpleDateFormat syntax) -# jetty.requestlog.filenameDateFormat=yyyy_MM_dd - -## How many days to retain old log files -# jetty.requestlog.retainDays=90 - -## Whether to append to existing file -# jetty.requestlog.append=false - -## Timezone of the log file rollover -# jetty.requestlog.timezone=GMT -# end::documentation[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/resources.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/resources.mod deleted file mode 100644 index cf2e9a24ea44..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/resources.mod +++ /dev/null @@ -1,36 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -# tag::description[] -This module adds the `$JETTY_BASE/resources` directory to the server's classpath. -# end::description[] - -[tags] -classpath - -[lib] -resources/ - -[files] -resources/ - diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/security.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/security.mod deleted file mode 100644 index 7a0646e13b8c..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/security.mod +++ /dev/null @@ -1,30 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Adds core security handling to the classpath. - -[depend] -server - -[lib] -lib/jetty-security-${jetty.version}.jar diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/server.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/server.mod deleted file mode 100644 index 4be55e5f8e95..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/server.mod +++ /dev/null @@ -1,147 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables and configures the Jetty server. -This module does not enable any network protocol support. -To enable a specific network protocol such as HTTP/1.1, you must enable the correspondent Jetty module. - -[after] -jvm -ext -resources - -[depend] -threadpool -bytebufferpool -logging - -[lib] -lib/jetty-http-${jetty.version}.jar -lib/jetty-server-${jetty.version}.jar -lib/jetty-xml-${jetty.version}.jar -lib/jetty-util-${jetty.version}.jar -lib/jetty-io-${jetty.version}.jar - -[xml] -etc/jetty.xml - -[ini-template] -# tag::documentation-http-config[] -### Common HTTP configuration -## Scheme to use to build URIs for secure redirects -# jetty.httpConfig.secureScheme=https - -## Port to use to build URIs for secure redirects -# jetty.httpConfig.securePort=8443 - -## Response content buffer size (in bytes) -# jetty.httpConfig.outputBufferSize=32768 - -## Max response content write length that is buffered (in bytes) -# jetty.httpConfig.outputAggregationSize=8192 - -## If HTTP/1.x persistent connections should be enabled -# jetty.httpConfig.persistentConnectionsEnabled=true - -## Max request headers size (in bytes) -# jetty.httpConfig.requestHeaderSize=8192 - -## Max response headers size (in bytes) -# jetty.httpConfig.responseHeaderSize=8192 - -## Whether to send the Server: header -# jetty.httpConfig.sendServerVersion=true - -## Whether to send the Date: header -# jetty.httpConfig.sendDateHeader=false - -## Max per-connection header cache size (in nodes) -# jetty.httpConfig.headerCacheSize=1024 - -## Whether, for requests with content, delay dispatch until some content has arrived -# jetty.httpConfig.delayDispatchUntilContent=true - -## Maximum number of error dispatches to prevent looping -# jetty.httpConfig.maxErrorDispatches=10 - -## Relative Redirect Locations allowed -# jetty.httpConfig.relativeRedirectAllowed=true - -## Whether to use direct ByteBuffers for reading or writing -# jetty.httpConfig.useInputDirectByteBuffers=true -# jetty.httpConfig.useOutputDirectByteBuffers=true -# end::documentation-http-config[] - -# tag::documentation-server-compliance[] -## HTTP Compliance: RFC7230, RFC7230_LEGACY, RFC2616, RFC2616_LEGACY, LEGACY -# jetty.httpConfig.compliance=RFC7230 - -## URI Compliance: DEFAULT, LEGACY, RFC3986, RFC3986_UNAMBIGUOUS, UNSAFE -# jetty.httpConfig.uriCompliance=DEFAULT - -## Cookie compliance mode for parsing request Cookie headers: RFC6265_STRICT, RFC6265, RFC6265_LEGACY, RFC2965, RFC2965_LEGACY -# jetty.httpConfig.requestCookieCompliance=RFC6265 - -## Cookie compliance mode for generating response Set-Cookie: RFC2965, RFC6265 -# jetty.httpConfig.responseCookieCompliance=RFC6265 -# end::documentation-server-compliance[] - -# tag::documentation-server-config[] -### Server configuration -## Whether ctrl+c on the console gracefully stops the Jetty server -# jetty.server.stopAtShutdown=true - -## Timeout in ms to apply when stopping the server gracefully -# jetty.server.stopTimeout=5000 - -## Dump the state of the Jetty server, components, and webapps after startup -# jetty.server.dumpAfterStart=false - -## The temporary directory used by the Jetty server and as a root for its contexts -# jetty.server.tempDirectory= - -## Dump the state of the Jetty server, components, and webapps before shutdown -# jetty.server.dumpBeforeStop=false -# end::documentation-server-config[] - -# tag::documentation-scheduler-config[] -### Server Scheduler Configuration -## The scheduler thread name, defaults to "Scheduler-{hashCode()}" if blank. -# jetty.scheduler.name= - -## Whether the server scheduler threads are daemon. -# jetty.scheduler.daemon=false - -## The number of server scheduler threads. -# jetty.scheduler.threads=1 -# end::documentation-scheduler-config[] - -## Whether the handlers of the ContextHandlerCollection can be updated once the server is started -## If set to false, then -deploy module jetty.deploy.scanInterval should also be set to 0. -# jetty.server.contexts.dynamic=true - -## Should the DefaultHandler serve the jetty favicon.ico from the root. -# jetty.server.default.serveFavIcon=true - -## Should the DefaultHandler show a list of known contexts in a root 404 response. -# jetty.server.default.showContexts=true diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/sessions.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/sessions.mod deleted file mode 100644 index a4cebd14eb42..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/sessions.mod +++ /dev/null @@ -1,47 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables session management. -By enabling this module, it allows session management to be configured via the ini templates -created or by enabling other session-cache or session-store modules. -Without this module enabled, -the server may still use sessions, but their management cannot be configured. - -[tags] -session - -[depends] -server - -[lib] -lib/jetty-session-${jetty.version}.jar - -[xml] -etc/sessions/id-manager.xml - -[ini-template] -## The name to uniquely identify this server instance -#jetty.sessionIdManager.workerName=node1 - -## Period between runs of the session scavenger (in seconds) -#jetty.sessionScavengeInterval.seconds=600 diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ssl.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ssl.mod deleted file mode 100644 index 9b9595fea47b..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/ssl.mod +++ /dev/null @@ -1,158 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables a TLS (SSL) connector to support secure protocols. -Secure HTTP/1.1 is provided by enabling the "https" module and secure HTTP/2 is provided by enabling the "http2" module. - -[tags] -connector -ssl -internal - -[depend] -server - -[xml] -etc/jetty-ssl.xml -etc/jetty-ssl-context.xml - -[ini-template] -# tag::documentation-connector[] -### TLS (SSL) Connector Configuration - -## The host/address to bind the connector to. -# jetty.ssl.host=0.0.0.0 - -## The port the connector listens on. -# jetty.ssl.port=8443 - -## The connector idle timeout, in milliseconds. -# jetty.ssl.idleTimeout=30000 - -## The number of acceptors (-1 picks a default value based on number of cores). -# jetty.ssl.acceptors=1 - -## The number of selectors (-1 picks a default value based on number of cores). -# jetty.ssl.selectors=-1 - -## The ServerSocketChannel accept queue backlog (0 picks the platform default). -# jetty.ssl.acceptQueueSize=0 - -## The thread priority delta to give to acceptor threads. -# jetty.ssl.acceptorPriorityDelta=0 - -## Whether to enable the SO_REUSEADDR socket option. -# jetty.ssl.reuseAddress=true - -## Whether to enable the SO_REUSEPORT socket option. -# jetty.ssl.reusePort=false - -## Whether to enable the TCP_NODELAY socket option on accepted sockets. -# jetty.ssl.acceptedTcpNoDelay=true - -## The SO_RCVBUF socket option to set on accepted sockets. -## A value of -1 indicates that the platform default is used. -# jetty.ssl.acceptedReceiveBufferSize=-1 - -## The SO_SNDBUF socket option to set on accepted sockets. -## A value of -1 indicates that the platform default is used. -# jetty.ssl.acceptedSendBufferSize=-1 - -## Whether client SNI data is required for all secure connections. -## When SNI is required, clients that do not send SNI data are rejected with an HTTP 400 response. -# jetty.ssl.sniRequired=false - -## Whether client SNI data is checked to match CN and SAN in server certificates. -## When SNI is checked, if the match fails the connection is rejected with an HTTP 400 response. -# jetty.ssl.sniHostCheck=true - -## The max age, in seconds, for the Strict-Transport-Security response header. -# jetty.ssl.stsMaxAgeSeconds=31536000 - -## Whether to include the subdomain property in any Strict-Transport-Security header. -# jetty.ssl.stsIncludeSubdomains=true -# end::documentation-connector[] - -# tag::documentation-ssl-context[] -### SslContextFactory Configuration -## Note that OBF passwords are not secure, just protected from casual observation. - -## Whether client SNI data is required for all secure connections. -## When SNI is required, clients that do not send SNI data are rejected with a TLS handshake error. -# jetty.sslContext.sniRequired=false - -## The Endpoint Identification Algorithm. -## Same as javax.net.ssl.SSLParameters#setEndpointIdentificationAlgorithm(String). -# jetty.sslContext.endpointIdentificationAlgorithm= - -## The JSSE Provider. -# jetty.sslContext.provider= - -## The KeyStore file path, either an absolute path or a relative path to $JETTY_BASE. -# jetty.sslContext.keyStorePath=etc/keystore.p12 - -## The TrustStore file path, either an absolute path or a relative path to $JETTY_BASE. -# jetty.sslContext.trustStorePath=etc/keystore.p12 - -## The KeyStore password. -# jetty.sslContext.keyStorePassword= - -## The Keystore type. -# jetty.sslContext.keyStoreType=PKCS12 - -## The KeyStore provider. -# jetty.sslContext.keyStoreProvider= - -## The KeyManager password. -# jetty.sslContext.keyManagerPassword= - -## The TrustStore password. -# jetty.sslContext.trustStorePassword= - -## The TrustStore type. -# jetty.sslContext.trustStoreType=PKCS12 - -## The TrustStore provider. -# jetty.sslContext.trustStoreProvider= - -## Whether client certificate authentication is required. -# jetty.sslContext.needClientAuth=false - -## Whether client certificate authentication is desired, but not required. -# jetty.sslContext.wantClientAuth=false - -## Whether cipher order is significant. -# jetty.sslContext.useCipherSuitesOrder=true - -## The SSLSession cache size. -# jetty.sslContext.sslSessionCacheSize=-1 - -## The SSLSession cache timeout (in seconds). -# jetty.sslContext.sslSessionTimeout=-1 - -## Whether TLS renegotiation is allowed. -# jetty.sslContext.renegotiationAllowed=true - -## The max number of TLS renegotiations per connection. -# jetty.sslContext.renegotiationLimit=5 -# end::documentation-ssl-context[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/threadpool.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/threadpool.mod deleted file mode 100644 index 681e970f7e6b..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/threadpool.mod +++ /dev/null @@ -1,61 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -# DO NOT EDIT - See: https://jetty.org/docs/index.html - -[description] -Enables and configures the Server ThreadPool. - -[depends] -logging - -[provides] -threadpool|default - -[xml] -etc/jetty-threadpool.xml - -[ini-template] -# tag::documentation[] -## Thread name prefix. -#jetty.threadPool.namePrefix=qtp - -## Minimum number of pooled threads. -#jetty.threadPool.minThreads=10 - -## Maximum number of pooled threads. -#jetty.threadPool.maxThreads=200 - -## Number of reserved threads (-1 for heuristic). -#jetty.threadPool.reservedThreads=-1 - -## Whether to use virtual threads, if the runtime supports them. -## Deprecated, use Jetty module 'threadpool-virtual' instead. -#jetty.threadPool.useVirtualThreads=false - -## Thread idle timeout (in milliseconds). -#jetty.threadPool.idleTimeout=60000 - -## The max number of idle threads that are evicted in one idleTimeout period. -#jetty.threadPool.maxEvictCount=1 - -## Whether to output a detailed dump. -#jetty.threadPool.detailedDump=false -# end::documentation[] diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki-logging.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki-logging.mod deleted file mode 100644 index 23b00e438f35..000000000000 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki-logging.mod +++ /dev/null @@ -1,43 +0,0 @@ -# --------------------------------------------------------------------------- -# See the NOTICE file distributed with this work for additional -# information regarding copyright ownership. -# -# This is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation; either version 2.1 of -# the License, or (at your option) any later version. -# -# This software is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this software; if not, write to the Free -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -# 02110-1301 USA, or see the FSF site: http://www.fsf.org. -# --------------------------------------------------------------------------- - -[description] -Base configuration for the jetty logging mechanism. -Provides a ${jetty.base}/resources/jetty-logging.properties. - -[tags] -logging - -[depend] -logging/slf4j -resources - -[provides] -logging|default - -[files] -basehome:modules/logging/jetty - -[lib] -lib/logging/jetty-slf4j-impl-${jetty.version}.jar - -[ini] -jetty.webapp.addHiddenClasses+=,org.eclipse.jetty.logging. -jetty.webapp.addHiddenClasses+=,${jetty.home.uri}/lib/logging/ diff --git a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki.mod b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki.mod index df6f98b11487..feef54c548df 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki.mod +++ b/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources/jetty/modules/xwiki.mod @@ -23,18 +23,13 @@ [depend] ext -resources -server -logging +console-capture +ee10-apache-jsp +ee10-deploy +ee10-websocket-jakarta http http-forwarded -ee8-annotations -ee8-deploy -requestlog -ee8-websocket-javax -ee8-websocket-jetty -ee8-apache-jsp -console-capture +work [xml] -etc/jetty-xwiki.xml +etc/xwiki.xml diff --git a/xwiki-platform-tools/xwiki-platform-tool-packager-plugin/pom.xml b/xwiki-platform-tools/xwiki-platform-tool-packager-plugin/pom.xml index 05a07eac0ec6..e7c84ab61a24 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-packager-plugin/pom.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-packager-plugin/pom.xml @@ -148,8 +148,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api runtime diff --git a/xwiki-platform-tools/xwiki-platform-tool-provision-plugin/pom.xml b/xwiki-platform-tools/xwiki-platform-tool-provision-plugin/pom.xml index 9a7861c201bf..d334a9e88e20 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-provision-plugin/pom.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-provision-plugin/pom.xml @@ -85,8 +85,8 @@ commons-httpclient - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api compile diff --git a/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/pom.xml b/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/pom.xml index 06eabf42045b..27d06325f3cf 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/pom.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/pom.xml @@ -36,8 +36,8 @@ - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/src/main/java/com/xpn/xwiki/XWikiRootServlet.java b/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/src/main/java/com/xpn/xwiki/XWikiRootServlet.java index 520be6492701..a8f5dc303995 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/src/main/java/com/xpn/xwiki/XWikiRootServlet.java +++ b/xwiki-platform-tools/xwiki-platform-tool-rootwebapp/src/main/java/com/xpn/xwiki/XWikiRootServlet.java @@ -21,10 +21,10 @@ import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * The root servlet for XWiki. The purpose of this servlet is to respond to WebDAV requests correctly and to redirect diff --git a/xwiki-platform-tools/xwiki-platform-tool-standards-validator/pom.xml b/xwiki-platform-tools/xwiki-platform-tool-standards-validator/pom.xml index 38b10bc47795..d162e30f4523 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-standards-validator/pom.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-standards-validator/pom.xml @@ -76,8 +76,8 @@ jetty-server - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api diff --git a/xwiki-platform-tools/xwiki-platform-tool-xmldoc-update-plugin/pom.xml b/xwiki-platform-tools/xwiki-platform-tool-xmldoc-update-plugin/pom.xml index 2e1a7e1bb9f5..cf045699deea 100644 --- a/xwiki-platform-tools/xwiki-platform-tool-xmldoc-update-plugin/pom.xml +++ b/xwiki-platform-tools/xwiki-platform-tool-xmldoc-update-plugin/pom.xml @@ -53,8 +53,8 @@ ${commons.version} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api compile @@ -106,6 +106,7 @@ log4j-over-slf4j runtime + org.xwiki.platform