1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
import java.util.Date
import java.text.MessageFormat
def vartimestamp = null
def env = System.getenv()
if ((vartimestamp=env['BUILD_ID'])==null){
vartimestamp = MessageFormat.format("{0,date,yyyyMMdd-HH:mm:ss}", new Date())
}
project.properties['buildtimestamp'] = vartimestamp
</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build> |