Skip to content

Commit

Permalink
HBX-2963 Use maven-injection-plugin to set the version string in the …
Browse files Browse the repository at this point in the history
…org.hibernate.tool.api.version.Version
  • Loading branch information
marko-bekhta committed Dec 2, 2024
1 parent 0584bc4 commit 552dbe2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
22 changes: 22 additions & 0 deletions orm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,26 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-injection-plugin</artifactId>
<configuration>
<bytecodeInjections>
<bytecodeInjection>
<expression>${project.version}</expression>
<targetMembers>
<constant>
<className>org.hibernate.tool.api.version.Version</className>
<fieldName>CURRENT_VERSION</fieldName>
</constant>
</targetMembers>
</bytecodeInjection>
</bytecodeInjections>
</configuration>
</plugin>
</plugins>
</build>

</project>
5 changes: 3 additions & 2 deletions orm/src/main/java/org/hibernate/tool/api/version/Version.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.hibernate.tool.api.version;

public interface Version {

final static String CURRENT_VERSION = "7.0.0-SNAPSHOT";

// An actual version is set by the `maven-injection-plugin` during the build time.
final static String CURRENT_VERSION = "UNKNOWN";

}

0 comments on commit 552dbe2

Please sign in to comment.