From 9610df3c771e3fa323af7826f17469ce30ea71ad Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 27 Feb 2025 15:26:48 +0100 Subject: [PATCH] HBX-2962: Inject the version string during the build Signed-off-by: Koen Aers --- orm/pom.xml | 22 +++++++++++++++++++ .../hibernate/tool/api/version/Version.java | 13 +++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/orm/pom.xml b/orm/pom.xml index b5e683c8aa..40758c3cd1 100644 --- a/orm/pom.xml +++ b/orm/pom.xml @@ -82,4 +82,26 @@ + + + + org.jboss.maven.plugins + maven-injection-plugin + + + + ${project.version} + + + org.hibernate.tool.api.version.Version + versionString + + + + + + + + + diff --git a/orm/src/main/java/org/hibernate/tool/api/version/Version.java b/orm/src/main/java/org/hibernate/tool/api/version/Version.java index 319da9292d..4447b9615e 100644 --- a/orm/src/main/java/org/hibernate/tool/api/version/Version.java +++ b/orm/src/main/java/org/hibernate/tool/api/version/Version.java @@ -1,7 +1,16 @@ package org.hibernate.tool.api.version; public interface Version { - - final static String CURRENT_VERSION = "6.5.4-SNAPSHOT"; + + /** + * @deprecated Use {@link #versionString()} instead. + */ + @Deprecated + final static String CURRENT_VERSION = versionString(); + + static String versionString() { + // This implementation is replaced during the build with another one that returns the correct value. + return "UNKNOWN"; + } }