HHH-4813 - annotation and entitymanager module should use the maven-injection-plugin to generate version string
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18575 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
55cd2ee2a2
commit
edb211e8af
|
@ -106,10 +106,27 @@
|
|||
<groupId>org.jboss.maven.plugins</groupId>
|
||||
<artifactId>maven-test-ext-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jboss.maven.plugins</groupId>
|
||||
<artifactId>maven-injection-plugin</artifactId>
|
||||
<configuration>
|
||||
<bytecodeInjections>
|
||||
<bytecodeInjection>
|
||||
<expression>${pom.version}</expression>
|
||||
<targetMembers>
|
||||
<methodBodyReturn>
|
||||
<className>org.hibernate.cfg.annotations.Version</className>
|
||||
<methodName>getVersionString</methodName>
|
||||
</methodBodyReturn>
|
||||
</targetMembers>
|
||||
</bytecodeInjection>
|
||||
</bytecodeInjections>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.twdata.maven</groupId>
|
||||
<artifactId>maven-cli-plugin</artifactId>
|
||||
<version>0.6.3.CR2</version>
|
||||
<version>0.6.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// $Id:$
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
|
@ -23,8 +24,6 @@
|
|||
*/
|
||||
package org.hibernate.cfg.annotations;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -32,11 +31,14 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class Version {
|
||||
public static final String VERSION = "3.5.0." + new Date();
|
||||
private static Logger log = LoggerFactory.getLogger( Version.class );
|
||||
|
||||
public static String getVersionString() {
|
||||
return "[WORKING]";
|
||||
}
|
||||
|
||||
static {
|
||||
log.info( "Hibernate Annotations {}", VERSION );
|
||||
log.info( "Hibernate Annotations {}", getVersionString() );
|
||||
}
|
||||
|
||||
public static void touch() {
|
||||
|
|
|
@ -98,15 +98,6 @@
|
|||
<plugin>
|
||||
<groupId>org.jboss.maven.plugins</groupId>
|
||||
<artifactId>maven-injection-plugin</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>bytecode</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<bytecodeInjections>
|
||||
<bytecodeInjection>
|
||||
|
|
|
@ -85,6 +85,23 @@
|
|||
</testResource>
|
||||
</testResources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jboss.maven.plugins</groupId>
|
||||
<artifactId>maven-injection-plugin</artifactId>
|
||||
<configuration>
|
||||
<bytecodeInjections>
|
||||
<bytecodeInjection>
|
||||
<expression>${pom.version}</expression>
|
||||
<targetMembers>
|
||||
<methodBodyReturn>
|
||||
<className>org.hibernate.ejb.Version</className>
|
||||
<methodName>getVersionString</methodName>
|
||||
</methodBodyReturn>
|
||||
</targetMembers>
|
||||
</bytecodeInjection>
|
||||
</bytecodeInjections>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// $Id:$
|
||||
/*
|
||||
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
|
@ -23,8 +24,6 @@
|
|||
//$Id$
|
||||
package org.hibernate.ejb;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -33,11 +32,14 @@ import org.slf4j.LoggerFactory;
|
|||
* @author Emmanuel Bernard
|
||||
*/
|
||||
public class Version {
|
||||
public static final String VERSION = "3.5.0." + new Date();
|
||||
private static final Logger log = LoggerFactory.getLogger( Version.class );
|
||||
private static Logger log = LoggerFactory.getLogger( Version.class );
|
||||
|
||||
public static String getVersionString() {
|
||||
return "[WORKING]";
|
||||
}
|
||||
|
||||
static {
|
||||
log.info( "Hibernate EntityManager {}", VERSION );
|
||||
log.info( "Hibernate EntityManager {}", getVersionString() );
|
||||
}
|
||||
|
||||
public static void touch() {
|
||||
|
|
|
@ -323,6 +323,19 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jboss.maven.plugins</groupId>
|
||||
<artifactId>maven-injection-plugin</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>bytecode</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
|
|
Loading…
Reference in New Issue