Skip to content

Commit 070d284

Browse files
committed
Upgrade to Hibernate 6.
Introduce bytebuddy exclusions to avoid clashes with Mockito-provided byte buddy versions. Extend version range in Jackson Hibernate module registrar. Closes #2158
1 parent 07ebc50 commit 070d284

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<springdata.keyvalue>3.0.0-SNAPSHOT</springdata.keyvalue>
3636
<servlet.version>5.0.0</servlet.version>
3737

38-
<hibernate.version>5.5.7.Final</hibernate.version>
38+
<hibernate.version>6.1.1.Final</hibernate.version>
3939
</properties>
4040

4141
<developers>

spring-data-rest-tests/spring-data-rest-tests-jpa/pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@
3535
</dependency>
3636

3737
<dependency>
38-
<groupId>org.hibernate</groupId>
39-
<artifactId>hibernate-core-jakarta</artifactId>
38+
<groupId>org.hibernate.orm</groupId>
39+
<artifactId>hibernate-core</artifactId>
4040
<version>${hibernate.version}</version>
41+
<!-- Avoid conflicts with ByteBuddy brought by Mockito -->
42+
<exclusions>
43+
<exclusion>
44+
<groupId>net.bytebuddy</groupId>
45+
<artifactId>byte-buddy</artifactId>
46+
</exclusion>
47+
</exclusions>
4148
</dependency>
4249

4350
<dependency>

spring-data-rest-tests/spring-data-rest-tests-mongodb/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<dependency>
3737
<groupId>org.mongodb</groupId>
3838
<artifactId>mongodb-driver-sync</artifactId>
39-
<version>4.5.0</version>
39+
<version>4.6.0</version>
4040
</dependency>
4141

4242
<dependency>

spring-data-rest-webmvc/pom.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,17 @@
7878
</dependency>
7979

8080
<dependency>
81-
<groupId>org.hibernate</groupId>
81+
<groupId>org.hibernate.orm</groupId>
8282
<artifactId>hibernate-core</artifactId>
8383
<version>${hibernate.version}</version>
8484
<optional>true</optional>
85+
<!-- Avoid conflicts with ByteBuddy brought by Mockito -->
86+
<exclusions>
87+
<exclusion>
88+
<groupId>net.bytebuddy</groupId>
89+
<artifactId>byte-buddy</artifactId>
90+
</exclusion>
91+
</exclusions>
8592
</dependency>
8693

8794
<!-- Querydsl -->

spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/Jackson2DatatypeHelper.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*
2727
* @author Jon Brisbin
2828
* @author Oliver Gierke
29+
* @author Mark Paluch
2930
*/
3031
public class Jackson2DatatypeHelper {
3132

@@ -37,7 +38,8 @@ public class Jackson2DatatypeHelper {
3738

3839
public static void configureObjectMapper(ObjectMapper mapper) {
3940

40-
if (IS_HIBERNATE_AVAILABLE && HibernateVersions.isHibernate5() && IS_HIBERNATE5_MODULE_AVAILABLE) {
41+
if (IS_HIBERNATE_AVAILABLE && (HibernateVersions.isHibernate5() || HibernateVersions.isHibernate6())
42+
&& IS_HIBERNATE5_MODULE_AVAILABLE) {
4143
new Hibernate5ModuleRegistrar().registerModule(mapper);
4244
}
4345
}
@@ -47,6 +49,10 @@ private static class HibernateVersions {
4749
public static boolean isHibernate5() {
4850
return Version.getVersionString().startsWith("5");
4951
}
52+
53+
public static boolean isHibernate6() {
54+
return Version.getVersionString().startsWith("6");
55+
}
5056
}
5157

5258
private static class Hibernate5ModuleRegistrar {

0 commit comments

Comments
 (0)