Skip to content

Commit b99bc9c

Browse files
mszabo-wikiasenivam
authored andcommitted
Update to Bean Validation 2.0 (Hibernate 6) (#3908)
* Update to Bean Validation 2.0 (Hibernate 6) Signed-off-by: mszabo-wikia <[email protected]>
1 parent dbd36ce commit b99bc9c

File tree

17 files changed

+89
-28
lines changed

17 files changed

+89
-28
lines changed

examples/declarative-linking/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</dependency>
5151

5252
<dependency>
53-
<groupId>org.glassfish.web</groupId>
53+
<groupId>org.glassfish</groupId>
5454
<artifactId>javax.el</artifactId>
5555
</dependency>
5656

ext/bean-validation/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<artifactId>validation-api</artifactId>
8484
</dependency>
8585
<dependency>
86-
<groupId>org.hibernate</groupId>
86+
<groupId>org.hibernate.validator</groupId>
8787
<artifactId>hibernate-validator</artifactId>
8888
</dependency>
8989

@@ -94,7 +94,7 @@
9494
</dependency>
9595

9696
<dependency>
97-
<groupId>org.glassfish.web</groupId>
97+
<groupId>org.glassfish</groupId>
9898
<artifactId>javax.el</artifactId>
9999
</dependency>
100100

ext/cdi/jersey-cdi1x-validation/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</dependency>
4242

4343
<dependency>
44-
<groupId>org.hibernate</groupId>
44+
<groupId>org.hibernate.validator</groupId>
4545
<artifactId>hibernate-validator-cdi</artifactId>
4646
<scope>provided</scope>
4747
</dependency>
@@ -51,6 +51,13 @@
5151
<artifactId>cdi-api</artifactId>
5252
<scope>provided</scope>
5353
<version>1.2</version>
54+
<exclusions>
55+
<!-- Remove ancient javax.el that causes problems with Hibernate -->
56+
<exclusion>
57+
<groupId>javax.el</groupId>
58+
<artifactId>el-api</artifactId>
59+
</exclusion>
60+
</exclusions>
5461
</dependency>
5562

5663
</dependencies>

ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import javax.interceptor.Interceptor;
2828
import javax.interceptor.InvocationContext;
2929

30-
import org.hibernate.validator.internal.cdi.interceptor.MethodValidated;
31-
import org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor;
30+
import org.hibernate.validator.cdi.internal.interceptor.MethodValidated;
31+
import org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor;
3232

3333
/**
3434
* JAX-RS wrapper for Hibernate CDI bean validation interceptor.

ext/cdi/jersey-cdi1x-validation/src/main/java/org/glassfish/jersey/ext/cdi1x/validation/internal/CdiInterceptorWrapperExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import org.glassfish.jersey.internal.util.collection.Cache;
4444
import org.glassfish.jersey.server.model.Resource;
4545

46-
import org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor;
46+
import org.hibernate.validator.cdi.internal.interceptor.ValidationInterceptor;
4747

4848
/**
4949
* CDI extension to register {@link CdiInterceptorWrapper}.
@@ -78,7 +78,7 @@ private void beforeBeanDiscovery(@Observes BeforeBeanDiscovery beforeBeanDiscove
7878
* @param afterTypeDiscovery CDI bootstrap event.
7979
*/
8080
private void afterTypeDiscovery(@Observes final AfterTypeDiscovery afterTypeDiscovery) {
81-
afterTypeDiscovery.getInterceptors().remove(ValidationInterceptor.class);
81+
afterTypeDiscovery.getInterceptors().removeIf(ValidationInterceptor.class::equals);
8282
}
8383

8484
/**

ext/mvc-bean-validation/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<groupId>javax.el</groupId>
5959
<artifactId>javax.el-api</artifactId>
6060
</exclusion>
61+
<exclusion>
62+
<groupId>org.glassfish</groupId>
63+
<artifactId>javax.el</artifactId>
64+
</exclusion>
6165
</exclusions>
6266
</dependency>
6367
</dependencies>

incubator/declarative-linking/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<scope>provided</scope>
5555
</dependency>
5656
<dependency>
57-
<groupId>org.glassfish.web</groupId>
57+
<groupId>org.glassfish</groupId>
5858
<artifactId>javax.el</artifactId>
5959
<scope>provided</scope>
6060
</dependency>

media/json-binding/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@
7777
<dependency>
7878
<groupId>org.eclipse</groupId>
7979
<artifactId>yasson</artifactId>
80+
<exclusions>
81+
<!-- Remove ancient javax.el that causes problems with Hibernate -->
82+
<exclusion>
83+
<groupId>javax.el</groupId>
84+
<artifactId>el-api</artifactId>
85+
</exclusion>
86+
</exclusions>
8087
</dependency>
8188

8289
<dependency>

pom.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@
16561656
<version>${javax.el.version}</version>
16571657
</dependency>
16581658
<dependency>
1659-
<groupId>org.glassfish.web</groupId>
1659+
<groupId>org.glassfish</groupId>
16601660
<artifactId>javax.el</artifactId>
16611661
<version>${javax.el.impl.version}</version>
16621662
</dependency>
@@ -1673,13 +1673,13 @@
16731673
</dependency>
16741674

16751675
<dependency>
1676-
<groupId>org.hibernate</groupId>
1676+
<groupId>org.hibernate.validator</groupId>
16771677
<artifactId>hibernate-validator</artifactId>
16781678
<version>${validation.impl.version}</version>
16791679
</dependency>
16801680

16811681
<dependency>
1682-
<groupId>org.hibernate</groupId>
1682+
<groupId>org.hibernate.validator</groupId>
16831683
<artifactId>hibernate-validator-cdi</artifactId>
16841684
<version>${validation.impl.version}</version>
16851685
</dependency>
@@ -1943,11 +1943,11 @@
19431943
<javassist.version>3.22.0-CR2</javassist.version>
19441944
<javax.annotation.version>1.2</javax.annotation.version>
19451945
<javax.annotation.bundle.version>1.2</javax.annotation.bundle.version>
1946-
<javax.el.version>2.2.4</javax.el.version>
1947-
<javax.el.impl.version>2.2.4</javax.el.impl.version>
1946+
<javax.el.version>3.0.1-b06</javax.el.version>
1947+
<javax.el.impl.version>3.0.1-b09</javax.el.impl.version>
19481948
<javax.interceptor.version>1.2</javax.interceptor.version>
19491949
<javax.persistence.version>1.0</javax.persistence.version>
1950-
<javax.validation.api.version>1.1.0.Final</javax.validation.api.version>
1950+
<javax.validation.api.version>2.0.1.Final</javax.validation.api.version>
19511951
<jaxb.api.version>2.2.7</jaxb.api.version>
19521952
<jaxb.ri.version>2.2.7</jaxb.ri.version>
19531953
<jsonb.api.version>1.0</jsonb.api.version>
@@ -1990,7 +1990,7 @@
19901990
<simple.version>6.0.1</simple.version>
19911991
<slf4j.version>1.7.12</slf4j.version>
19921992
<spring4.version>4.3.4.RELEASE</spring4.version>
1993-
<validation.impl.version>5.1.3.Final</validation.impl.version> <!-- 5.3.3.Final doesn't work - osgi bv tests -->
1993+
<validation.impl.version>6.0.11.Final</validation.impl.version>
19941994
<weld.version>2.2.14.Final</weld.version> <!-- 2.4.1 doesn't work - bv tests -->
19951995
<weld3.version>3.0.0.Final</weld3.version>
19961996
<xerces.version>2.11.0</xerces.version>

tests/integration/cdi-beanvalidation-webapp/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,21 @@
4646
<groupId>javax.enterprise</groupId>
4747
<artifactId>cdi-api</artifactId>
4848
<scope>provided</scope>
49+
<exclusions>
50+
<!-- Remove ancient javax.el that causes problems with Hibernate -->
51+
<exclusion>
52+
<groupId>javax.el</groupId>
53+
<artifactId>el-api</artifactId>
54+
</exclusion>
55+
</exclusions>
4956
</dependency>
5057
<dependency>
5158
<groupId>org.glassfish.jersey.ext</groupId>
5259
<artifactId>jersey-bean-validation</artifactId>
5360
<scope>provided</scope>
5461
</dependency>
5562
<dependency>
56-
<groupId>org.hibernate</groupId>
63+
<groupId>org.hibernate.validator</groupId>
5764
<artifactId>hibernate-validator-cdi</artifactId>
5865
<scope>provided</scope>
5966
</dependency>

0 commit comments

Comments
 (0)