Skip to content

Commit

Permalink
XCOMMONS-2963: Upgrade to Servlet 5.0
Browse files Browse the repository at this point in the history
XCOMMONS-2108: Upgrade to Bean Validation 3.0.2
XCOMMONS-2109: Upgrade to Hibernate Validator 8.0.1
XCOMMONS-2475: Use Expressly instead of Apache EL
  • Loading branch information
tmortagne committed Sep 18, 2024
1 parent 5eb9461 commit 53e8776
Show file tree
Hide file tree
Showing 69 changed files with 3,368 additions and 731 deletions.
19 changes: 8 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@
<javax.websocket.version>1.1</javax.websocket.version>
<jakarta.websocket.version>2.1.1</jakarta.websocket.version>

<!-- EL implementation -->
<!-- Use the same version as the one that comes with the custom XWiki Jetty application server -->
<apachache-el.version>9.0.90</apachache-el.version>

<webdrivermanager.version>5.9.2</webdrivermanager.version>

<!-- The recommended version of known extensions to use -->
Expand Down Expand Up @@ -1304,24 +1300,25 @@
<artifactId>cssparser</artifactId>
<version>0.9.30</version>
</dependency>

<!-- Bean validation -->
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.2.5.Final</version>
<version>8.0.1.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jasper</groupId>
<artifactId>apache-el</artifactId>
<version>${apachache-el.version}</version>
<!-- The EL implementation is supposed to come with the application server, but we need one for tests -->
<scope>test</scope>
<groupId>org.glassfish.expressly</groupId>
<artifactId>expressly</artifactId>
<version>5.0.0</version>
<!-- The implementation of Expression Language is supposed to come with the application server -->
<scope>provided</scope>
</dependency>

<!-- Mail -->
Expand Down
58 changes: 58 additions & 0 deletions xwiki-commons-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,64 @@
</differences>
</revapi.differences>
-->
<revapi.differences>
<justification>Not breakage from binary compatibility point of view</justification>
<criticality>allowed</criticality>
<differences>
<item>
<ignore>true</ignore>
<code>java.method.numberOfParametersChanged</code>
<old>method void org.xwiki.extension.wrap.WrappingIndexedExtension&lt;T extends org.xwiki.extension.index.IndexedExtension&gt;::&lt;init&gt;(T)</old>
<new>method void org.xwiki.extension.wrap.WrappingIndexedExtension&lt;T extends org.xwiki.extension.Extension&gt;::&lt;init&gt;()</new>
</item>
<item>
<ignore>true</ignore>
<code>java.class.superTypeTypeParametersChanged</code>
<old>class org.xwiki.extension.wrap.WrappingIndexedExtension&lt;T extends org.xwiki.extension.index.IndexedExtension&gt;</old>
<new>class org.xwiki.extension.wrap.WrappingIndexedExtension&lt;T extends org.xwiki.extension.Extension&gt;</new>
<oldSuperType>org.xwiki.extension.wrap.WrappingRatingExtension&lt;T extends org.xwiki.extension.index.IndexedExtension&gt;</oldSuperType>
<newSuperType>org.xwiki.extension.wrap.WrappingRatingExtension&lt;T extends org.xwiki.extension.Extension&gt;</newSuperType>
</item>
<item>
<ignore>true</ignore>
<code>java.method.numberOfParametersChanged</code>
<old>method void org.xwiki.extension.wrap.WrappingRatingExtension&lt;T extends org.xwiki.extension.rating.RatingExtension&gt;::&lt;init&gt;(T)</old>
<new>method void org.xwiki.extension.wrap.WrappingRatingExtension&lt;T extends org.xwiki.extension.Extension&gt;::&lt;init&gt;()</new>
</item>
<item>
<ignore>true</ignore>
<code>java.class.superTypeTypeParametersChanged</code>
<old>class org.xwiki.extension.wrap.WrappingRatingExtension&lt;T extends org.xwiki.extension.rating.RatingExtension&gt;</old>
<new>class org.xwiki.extension.wrap.WrappingRatingExtension&lt;T extends org.xwiki.extension.Extension&gt;</new>
<oldSuperType>org.xwiki.extension.wrap.WrappingRemoteExtension&lt;T extends org.xwiki.extension.rating.RatingExtension&gt;</oldSuperType>
<newSuperType>org.xwiki.extension.wrap.WrappingRemoteExtension&lt;T extends org.xwiki.extension.Extension&gt;</newSuperType>
</item>
<item>
<ignore>true</ignore>
<code>java.method.numberOfParametersChanged</code>
<old>method void org.xwiki.extension.wrap.WrappingRemoteExtension&lt;T extends org.xwiki.extension.RemoteExtension&gt;::&lt;init&gt;(T)</old>
<new>method void org.xwiki.extension.wrap.WrappingRemoteExtension&lt;T extends org.xwiki.extension.Extension&gt;::&lt;init&gt;()</new>
</item>
<item>
<ignore>true</ignore>
<code>java.class.superTypeTypeParametersChanged</code>
<old>class org.xwiki.extension.wrap.WrappingRemoteExtension&lt;T extends org.xwiki.extension.RemoteExtension&gt;</old>
<new>class org.xwiki.extension.wrap.WrappingRemoteExtension&lt;T extends org.xwiki.extension.Extension&gt;</new>
<oldSuperType>org.xwiki.extension.wrap.WrappingExtension&lt;T extends org.xwiki.extension.RemoteExtension&gt;</oldSuperType>
<newSuperType>org.xwiki.extension.wrap.WrappingExtension&lt;T extends org.xwiki.extension.Extension&gt;</newSuperType>
</item>
<item>
<ignore>true</ignore>
<code>java.annotation.attributeValueChanged</code>
<old>class org.xwiki.extension.repository.xwiki.model.jaxb.AbstractExtension</old>
<new>class org.xwiki.extension.repository.xwiki.model.jaxb.AbstractExtension</new>
<annotationType>javax.xml.bind.annotation.XmlType</annotationType>
<attribute>propOrder</attribute>
<oldValue>{"rating", "summary", "description", "licenses", "website", "authors", "features", "extensionFeatures", "scm", "issueManagement", "category", "allowedNamespaces", "recommended", "properties"}</oldValue>
<newValue>{"rating", "summary", "description", "licenses", "website", "authors", "supportPlans", "features", "extensionFeatures", "scm", "issueManagement", "category", "allowedNamespaces", "recommended", "properties"}</newValue>
</item>
</differences>
</revapi.differences>

<!-- Jakarta -->
<revapi.differences>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import java.lang.reflect.Type;
import java.util.Set;
Expand All @@ -35,15 +33,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.xwiki.component.JavaxProviderIntegrationTest;
import org.xwiki.component.descriptor.ComponentDescriptor;
import org.xwiki.component.descriptor.DefaultComponentDescriptor;
import org.xwiki.component.internal.ContextComponentManagerProvider;
import org.xwiki.component.internal.RootComponentManager;
import org.xwiki.component.internal.embed.EmbeddableComponentManagerFactory;
import org.xwiki.component.internal.multi.DefaultComponentManagerManager;
import org.xwiki.component.internal.namespace.DefaultNamespaceValidator;
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.component.util.DefaultParameterizedType;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.xwiki.component.annotation.Component;
import org.xwiki.jakartabridge.servlet.ServletBridge;
import org.xwiki.jakartabridge.servlet.JakartaServletBridge;

import jakarta.servlet.ServletContext;

Expand Down Expand Up @@ -60,7 +60,7 @@ public class ServletEnvironment extends AbstractEnvironment
public void setServletContext(javax.servlet.ServletContext servletContext)
{
this.javaxServletContext = servletContext;
this.jakartaServletContext = ServletBridge.toJakarta(servletContext);
this.jakartaServletContext = JakartaServletBridge.toJakarta(servletContext);
}

/**
Expand All @@ -79,7 +79,7 @@ public void setServletContext(ServletContext servletContext)
public javax.servlet.ServletContext getServletContext()
{
if (this.javaxServletContext == null) {
this.javaxServletContext = ServletBridge.toJavax(getJakartaServletContext());
this.javaxServletContext = JakartaServletBridge.toJavax(getJakartaServletContext());
}

return this.javaxServletContext;
Expand Down
2 changes: 1 addition & 1 deletion xwiki-commons-core/xwiki-commons-jakartabridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<artifactId>xwiki-commons-core</artifactId>
<groupId>org.xwiki.commons</groupId>
<version>16.6.0-SNAPSHOT</version>
<version>16.9.0-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-jakartabridge</artifactId>
<name>XWiki Commons - Jakarta Bridge</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<artifactId>xwiki-commons-jakartabridge</artifactId>
<groupId>org.xwiki.commons</groupId>
<version>16.6.0-SNAPSHOT</version>
<version>16.9.0-SNAPSHOT</version>
</parent>
<artifactId>xwiki-commons-jakartabridge-servlet</artifactId>
<name>XWiki Commons - Jakarta Bridge - Servlet</name>
Expand Down Expand Up @@ -56,7 +56,10 @@
<id>default</id>
<configuration>
<excludes>
org/xwiki/jakartabridge/servlet/ServletBridge.java
org/xwiki/jakartabridge/servlet/JakartaServletBridge.java,
org/xwiki/jakartabridge/servlet/internal/JakartaToJavaxHttpServletRequestWrapper.java,
org/xwiki/jakartabridge/servlet/internal/JavaxToJakartaHttpServletRequestWrapper.java,
org/xwiki/jakartabridge/servlet/internal/JavaxToJakartaServletContext.java
</excludes>
</configuration>
</execution>
Expand Down
Loading

0 comments on commit 53e8776

Please sign in to comment.