From 71cbca23a882dd10180ab0442cda536b69aad73a Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Mon, 2 Dec 2024 11:59:52 +0100 Subject: [PATCH] HBX-2992: Backport automated releases to branch 6.5 - Use maven-injection-plugin to set the version string in the org.hibernate.tool.api.version.Version --- orm/src/main/java/org/hibernate/tool/api/version/Version.java | 2 +- .../hibernate/tool/internal/export/common/TemplateHelper.java | 2 +- .../src/test/java/org/hibernate/tool/VersionTest/TestCase.java | 2 +- .../org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 4447b9615e..da4f560172 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 @@ -12,5 +12,5 @@ static String versionString() { // This implementation is replaced during the build with another one that returns the correct value. return "UNKNOWN"; } - + } diff --git a/orm/src/main/java/org/hibernate/tool/internal/export/common/TemplateHelper.java b/orm/src/main/java/org/hibernate/tool/internal/export/common/TemplateHelper.java index 3a8152feef..33722b7ce5 100644 --- a/orm/src/main/java/org/hibernate/tool/internal/export/common/TemplateHelper.java +++ b/orm/src/main/java/org/hibernate/tool/internal/export/common/TemplateHelper.java @@ -177,7 +177,7 @@ public void processString(String template, Writer output) { } public void setupContext() { - getContext().put("version", Version.CURRENT_VERSION); + getContext().put("version", Version.versionString()); getContext().put("ctx", getContext() ); //TODO: I would like to remove this, but don't know another way to actually get the list possible "root" keys for debugging. getContext().put("templates", new Templates()); diff --git a/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java index 3447393a51..cbd52f1357 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java @@ -45,7 +45,7 @@ public class TestCase { @Test public void testVersion() throws Exception { assertEquals( - org.hibernate.tool.api.version.Version.CURRENT_VERSION, + org.hibernate.tool.api.version.Version.versionString(), extractVersion(getPomXml())); } diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java index 3d51e38372..54fc9e3ceb 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java @@ -90,7 +90,7 @@ public void testSingleFileGeneration() { null, FileUtil.findFirstString("$", new File(outputDir, "artifacts.txt"))); assertEquals( - "File for artifacts in " + Version.CURRENT_VERSION, + "File for artifacts in " + Version.versionString(), FileUtil.findFirstString("artifacts", new File( outputDir, "artifacts.txt"))); }