File tree Expand file tree Collapse file tree 13 files changed +116
-38
lines changed
tools/jackson/datatype/hibernate5/jakarta
tools/jackson/datatype/hibernate6
tools/jackson/datatype/hibernate7 Expand file tree Collapse file tree 13 files changed +116
-38
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,6 @@ Hibernate (https://hibernate.org) version 5.5 with Jakarta data types.
106106 </configuration >
107107 </plugin >
108108
109- <plugin >
110- <groupId >org.moditect</groupId >
111- <artifactId >moditect-maven-plugin</artifactId >
112- <inherited >true</inherited >
113- <configuration >
114- <jvmVersion >11</jvmVersion >
115- </configuration >
116- </plugin >
117109 <!-- 05-Jul-2020, tatu: Add generation of Gradle Module Metadata -->
118110 <!-- 28-Feb-2025, jjohannes: Apply plugin last as it has to be the last of all 'package phase' plugins -->
119111 <plugin >
Original file line number Diff line number Diff line change 33 requires transitive tools .jackson .databind ;
44 requires transitive org .hibernate .orm .core ;
55
6- requires static tools .jackson .annotation ;
6+ requires static com .fasterxml .jackson .annotation ;
7+
78 requires static jakarta .activation ;
89 requires static jakarta .persistence ;
10+ requires static java .desktop ; // for java.beans
911
1012 exports tools .jackson .datatype .hibernate5 .jakarta ;
1113 opens tools .jackson .datatype .hibernate5 .jakarta ;
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ public class Hibernate5JakartaVersion {
44
55 public static String getHibernateVersion (){
66 try {
7- return Class .forName ("org.hibernate.Version" ).getPackage ().getImplementationVersion ();
7+ // Use Version.getVersionString() instead of Package.getImplementationVersion()
8+ // because the latter returns null in JPMS/module-info contexts
9+ Class <?> versionClass = Class .forName ("org.hibernate.Version" );
10+ return (String ) versionClass .getMethod ("getVersionString" ).invoke (null );
811 } catch (Exception e ) {
912 // Should not happen: hibernate not found in the classpath
1013 throw new RuntimeException (e );
Original file line number Diff line number Diff line change 1+ module tools .jackson .datatype .hibernate5 .jakarta {
2+ requires transitive tools .jackson .core ;
3+ requires transitive tools .jackson .databind ;
4+ requires transitive org .hibernate .orm .core ;
5+
6+ requires static com .fasterxml .jackson .annotation ;
7+
8+ requires static jakarta .activation ;
9+ requires static jakarta .persistence ;
10+ requires static java .desktop ; // for java.beans
11+
12+ // Test dependencies
13+ requires org .junit .jupiter .api ;
14+ requires jakarta .transaction ;
15+
16+ exports tools .jackson .datatype .hibernate5 .jakarta ;
17+ opens tools .jackson .datatype .hibernate5 .jakarta ;
18+
19+ // Export and open test packages
20+ exports tools .jackson .datatype .hibernate5 .jakarta .data ;
21+ opens tools .jackson .datatype .hibernate5 .jakarta .data ;
22+ exports tools .jackson .datatype .hibernate5 .jakarta .testutil ;
23+ opens tools .jackson .datatype .hibernate5 .jakarta .testutil ;
24+
25+ provides tools .jackson .databind .JacksonModule with
26+ tools .jackson .datatype .hibernate5 .jakarta .Hibernate5JakartaModule ;
27+
28+ uses jakarta .persistence .spi .PersistenceProvider ;
29+ }
Original file line number Diff line number Diff line change @@ -30,12 +30,12 @@ Hibernate (https://hibernate.org/) version 6.x with Jakarta data types.
3030 <dependency >
3131 <groupId >jakarta.transaction</groupId >
3232 <artifactId >jakarta.transaction-api</artifactId >
33- <version >2.0.1 </version >
33+ <version >2.0.0 </version >
3434 </dependency >
3535
3636 <!-- what would be the best scope to use here? -->
3737 <dependency >
38- <groupId >org.hibernate</groupId >
38+ <groupId >org.hibernate.orm </groupId >
3939 <artifactId >hibernate-core</artifactId >
4040 <version >${hibernate.version} </version >
4141 <scope >provided</scope >
@@ -91,13 +91,13 @@ Hibernate (https://hibernate.org/) version 6.x with Jakarta data types.
9191 <artifactId >cyclonedx-maven-plugin</artifactId >
9292 </plugin >
9393 <plugin >
94- <groupId >org.moditect</groupId >
95- <artifactId >moditect-maven-plugin</artifactId >
96- <inherited >true</inherited >
94+ <groupId >org.apache.maven.plugins</groupId >
95+ <artifactId >maven-surefire-plugin</artifactId >
9796 <configuration >
98- <jvmVersion >11</ jvmVersion >
97+ <argLine >--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-modules=ALL-MODULE-PATH</ argLine >
9998 </configuration >
10099 </plugin >
100+
101101 <!-- 05-Jul-2020, tatu: Add generation of Gradle Module Metadata -->
102102 <!-- 28-Feb-2025, jjohannes: Apply plugin last as it has to be the last of all 'package phase' plugins -->
103103 <plugin >
Original file line number Diff line number Diff line change 44 requires transitive org .hibernate .orm .core ;
55
66 requires static com .fasterxml .jackson .annotation ;
7- requires static jakarta .activation ;
7+ // requires static jakarta.activation;
88 requires static jakarta .persistence ;
9+ requires static java .desktop ; // for java.beans
910
1011 exports tools .jackson .datatype .hibernate6 ;
1112 opens tools .jackson .datatype .hibernate6 ;
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ public class Hibernate6Version {
44
55 public static String getHibernateVersion (){
66 try {
7- return Class .forName ("org.hibernate.Version" ).getPackage ().getImplementationVersion ();
7+ // Use Version.getVersionString() instead of Package.getImplementationVersion()
8+ // because the latter returns null in JPMS/module-info contexts
9+ Class <?> versionClass = Class .forName ("org.hibernate.Version" );
10+ return (String ) versionClass .getMethod ("getVersionString" ).invoke (null );
811 } catch (Exception e ) {
912 // Should not happen: hibernate not found in the classpath
1013 throw new RuntimeException (e );
Original file line number Diff line number Diff line change 1+ module tools .jackson .datatype .hibernate6 {
2+ requires transitive tools .jackson .core ;
3+ requires transitive tools .jackson .databind ;
4+ requires transitive org .hibernate .orm .core ;
5+
6+ requires static com .fasterxml .jackson .annotation ;
7+ //requires static jakarta.activation;
8+ requires jakarta .persistence ; // Non-static for tests - needed for JPA provider loading
9+ requires static java .desktop ; // for java.beans
10+
11+ // Test dependencies
12+ requires org .junit .jupiter .api ;
13+ requires jakarta .transaction ;
14+
15+ exports tools .jackson .datatype .hibernate6 ;
16+ opens tools .jackson .datatype .hibernate6 ;
17+
18+ // Export and open test packages
19+ exports tools .jackson .datatype .hibernate6 .data ;
20+ opens tools .jackson .datatype .hibernate6 .data ;
21+
22+ provides tools .jackson .databind .JacksonModule with
23+ tools .jackson .datatype .hibernate6 .Hibernate6Module ;
24+
25+ uses jakarta .persistence .spi .PersistenceProvider ;
26+ }
Original file line number Diff line number Diff line change 66
77 <persistence-unit name =" persistenceUnit" transaction-type =" RESOURCE_LOCAL" >
88 <provider >org.hibernate.jpa.HibernatePersistenceProvider</provider >
9- <class >data. tools.jackson.datatype.hibernate6.Customer</class >
10- <class >data. tools.jackson.datatype.hibernate6.Employee</class >
11- <class >data. tools.jackson.datatype.hibernate6.Office</class >
12- <class >data. tools.jackson.datatype.hibernate6.Order</class >
13- <class >data. tools.jackson.datatype.hibernate6.OrderDetail</class >
14- <class >data. tools.jackson.datatype.hibernate6.OrderDetailId</class >
15- <class >data. tools.jackson.datatype.hibernate6.Payment</class >
16- <class >data. tools.jackson.datatype.hibernate6.PaymentId</class >
17- <class >data. tools.jackson.datatype.hibernate6.Product</class >
9+ <class >tools.jackson.datatype.hibernate6.data .Customer</class >
10+ <class >tools.jackson.datatype.hibernate6.data .Employee</class >
11+ <class >tools.jackson.datatype.hibernate6.data .Office</class >
12+ <class >tools.jackson.datatype.hibernate6.data .Order</class >
13+ <class >tools.jackson.datatype.hibernate6.data .OrderDetail</class >
14+ <class >tools.jackson.datatype.hibernate6.data .OrderDetailId</class >
15+ <class >tools.jackson.datatype.hibernate6.data .Payment</class >
16+ <class >tools.jackson.datatype.hibernate6.data .PaymentId</class >
17+ <class >tools.jackson.datatype.hibernate6.data .Product</class >
1818 <properties >
1919 <property name =" jakarta.persistence.jdbc.driver" value =" org.h2.Driver" />
2020 <property name =" jakarta.persistence.jdbc.user" value =" " />
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Hibernate (https://hibernate.org/) version 7.x with Jakarta data types.
3030 <dependency >
3131 <groupId >jakarta.transaction</groupId >
3232 <artifactId >jakarta.transaction-api</artifactId >
33- <version >2.0.1 </version >
33+ <version >2.0.0 </version >
3434 </dependency >
3535
3636 <!-- what would be the best scope to use here? -->
@@ -90,14 +90,6 @@ Hibernate (https://hibernate.org/) version 7.x with Jakarta data types.
9090 <groupId >org.cyclonedx</groupId >
9191 <artifactId >cyclonedx-maven-plugin</artifactId >
9292 </plugin >
93- <plugin >
94- <groupId >org.moditect</groupId >
95- <artifactId >moditect-maven-plugin</artifactId >
96- <inherited >true</inherited >
97- <configuration >
98- <jvmVersion >11</jvmVersion >
99- </configuration >
100- </plugin >
10193 <!-- 05-Jul-2020, tatu: Add generation of Gradle Module Metadata -->
10294 <!-- 28-Feb-2025, jjohannes: Apply plugin last as it has to be the last of all 'package phase' plugins -->
10395 <plugin >
You can’t perform that action at this time.
0 commit comments