Skip to content

Commit 6740a15

Browse files
committed
HHH-14082
HHH-14082 Hibernate cannot determine it's core version in modular configuration
1 parent 058c56d commit 6740a15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hibernate-core/src/main/java/org/hibernate/Version.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.hibernate.internal.build.AllowSysOut;
99

1010
import java.lang.invoke.MethodHandles;
11+
import java.lang.module.ModuleDescriptor;
1112

1213
import static org.jboss.logging.Logger.getMessageLogger;
1314

@@ -21,8 +22,8 @@ public final class Version {
2122
private static final String VERSION = initVersion();
2223

2324
private static String initVersion() {
24-
final String version = Version.class.getPackage().getImplementationVersion();
25-
return version != null ? version : "[WORKING]";
25+
ModuleDescriptor moduleDescriptor = Version.class.getModule().getDescriptor() ;
26+
return moduleDescriptor != null ? (moduleDescriptor.version().isPresent() ? moduleDescriptor.version().toString() : "[WORKING]") : "[WORKING]";
2627
}
2728

2829
private Version() {

0 commit comments

Comments
 (0)