There's no solution but to workaround. Do you happened to use maven buildnumber-maven-plugin plugin?
If so, you can use it to generate revision for you and build timestamp. This timestamp will be with based on your local java time zone configuration.
Edit: Nevertheless question is about timestamp
, as Dean Schulze pointed out, only first execution
will break ${buildNumber}
. To fix that you'll have to add another execution
to your configuration that will create buildRevision
. Updated example, below.
For ex.:`
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version>
<inherited>true</inherited>
<executions>
<execution>
<id>generate-timestamp</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<format>{0,date,yyyy-MM-dd HH:mm:ss Z}</format>
<items>
<item>timestamp</item>
</items>
<buildNumberPropertyName>buildDateTime</buildNumberPropertyName>
<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
</configuration>
</execution>
<execution>
<id>generate-buildnumber</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<revisionOnScmFailure>0</revisionOnScmFailure>
<useLastCommittedRevision>true</useLastCommittedRevision>
<buildNumberPropertyName>buildRevision</buildNumberPropertyName>
</configuration>
</execution>
</executions>
Than you can use ${buildDateTime}
where you want to inject your timestamp variable. Another execution with the same goal will store you revision as well.