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
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -35,7 +35,7 @@
|
||||
<springdata.keyvalue>3.0.0-SNAPSHOT</springdata.keyvalue>
|
||||
<servlet.version>5.0.0</servlet.version>
|
||||
|
||||
<hibernate.version>5.5.7.Final</hibernate.version>
|
||||
<hibernate.version>6.1.1.Final</hibernate.version>
|
||||
</properties>
|
||||
|
||||
<developers>
|
||||
|
||||
@@ -35,9 +35,16 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core-jakarta</artifactId>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
<!-- Avoid conflicts with ByteBuddy brought by Mockito -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongodb-driver-sync</artifactId>
|
||||
<version>4.5.0</version>
|
||||
<version>4.6.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -78,10 +78,17 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<groupId>org.hibernate.orm</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>${hibernate.version}</version>
|
||||
<optional>true</optional>
|
||||
<!-- Avoid conflicts with ByteBuddy brought by Mockito -->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Querydsl -->
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.fasterxml.jackson.datatype.hibernate5.jakarta.Hibernate5JakartaModule
|
||||
*
|
||||
* @author Jon Brisbin
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class Jackson2DatatypeHelper {
|
||||
|
||||
@@ -37,7 +38,8 @@ public class Jackson2DatatypeHelper {
|
||||
|
||||
public static void configureObjectMapper(ObjectMapper mapper) {
|
||||
|
||||
if (IS_HIBERNATE_AVAILABLE && HibernateVersions.isHibernate5() && IS_HIBERNATE5_MODULE_AVAILABLE) {
|
||||
if (IS_HIBERNATE_AVAILABLE && (HibernateVersions.isHibernate5() || HibernateVersions.isHibernate6())
|
||||
&& IS_HIBERNATE5_MODULE_AVAILABLE) {
|
||||
new Hibernate5ModuleRegistrar().registerModule(mapper);
|
||||
}
|
||||
}
|
||||
@@ -47,6 +49,10 @@ public class Jackson2DatatypeHelper {
|
||||
public static boolean isHibernate5() {
|
||||
return Version.getVersionString().startsWith("5");
|
||||
}
|
||||
|
||||
public static boolean isHibernate6() {
|
||||
return Version.getVersionString().startsWith("6");
|
||||
}
|
||||
}
|
||||
|
||||
private static class Hibernate5ModuleRegistrar {
|
||||
|
||||
Reference in New Issue
Block a user