Skip to content

Commit 552dbe2

Browse files
committed
HBX-2963 Use maven-injection-plugin to set the version string in the org.hibernate.tool.api.version.Version
1 parent 0584bc4 commit 552dbe2

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

orm/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,26 @@
8787
</dependency>
8888
</dependencies>
8989

90+
<build>
91+
<plugins>
92+
<plugin>
93+
<groupId>org.jboss.maven.plugins</groupId>
94+
<artifactId>maven-injection-plugin</artifactId>
95+
<configuration>
96+
<bytecodeInjections>
97+
<bytecodeInjection>
98+
<expression>${project.version}</expression>
99+
<targetMembers>
100+
<constant>
101+
<className>org.hibernate.tool.api.version.Version</className>
102+
<fieldName>CURRENT_VERSION</fieldName>
103+
</constant>
104+
</targetMembers>
105+
</bytecodeInjection>
106+
</bytecodeInjections>
107+
</configuration>
108+
</plugin>
109+
</plugins>
110+
</build>
111+
90112
</project>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package org.hibernate.tool.api.version;
22

33
public interface Version {
4-
5-
final static String CURRENT_VERSION = "7.0.0-SNAPSHOT";
4+
5+
// An actual version is set by the `maven-injection-plugin` during the build time.
6+
final static String CURRENT_VERSION = "UNKNOWN";
67

78
}

0 commit comments

Comments
 (0)