File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
src/java/org/hibernate/tool Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 178178 </testResource >
179179 </testResources >
180180 <plugins >
181+ <plugin >
182+ <groupId >org.jboss.maven.plugins</groupId >
183+ <artifactId >maven-injection-plugin</artifactId >
184+ <configuration >
185+ <bytecodeInjections >
186+ <bytecodeInjection >
187+ <expression >${project.version} </expression >
188+ <targetMembers >
189+ <methodBodyReturn >
190+ <className >org.hibernate.tool.Version</className >
191+ <methodName >versionString</methodName >
192+ </methodBodyReturn >
193+ </targetMembers >
194+ </bytecodeInjection >
195+ </bytecodeInjections >
196+ </configuration >
197+ </plugin >
181198 <plugin >
182199 <groupId >org.apache.maven.plugins</groupId >
183200 <artifactId >maven-surefire-plugin</artifactId >
Original file line number Diff line number Diff line change 44
55final public class Version {
66
7- public static final String VERSION = "5.2.14-SNAPSHOT" ;
8-
97 private static final Version instance = new Version ();
108
9+ public static final String VERSION = instance .versionString ();
10+
1111 private static Logger log = Logger .getLogger ( Version .class .getName () );
1212
1313 static {
@@ -22,6 +22,11 @@ public String getVersion() {
2222 return VERSION ;
2323 }
2424
25+ public String versionString () {
26+ // This implementation is replaced during the build with another one that returns the correct value.
27+ return "UNKNOWN" ;
28+ }
29+
2530 public static Version getDefault () {
2631 return instance ;
2732 }
You can’t perform that action at this time.
0 commit comments