Thomas Marti's answer is a step in the right direction, but there's a simpler approach that does not require a dummy <scm> declaration in the POM. Use the buildnumber-maven-plugin, but use the create-timestamp goal. The documentation isn't clear; here's what it looks like to get a date in YYYY-MM-DD format and put it in the build.date property:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create-timestamp</goal>
</goals>
</execution>
</executions>
<configuration>
<timestampFormat>yyyy-MM-dd</timestampFormat>
<timestampPropertyName>build.date</timestampPropertyName>
</configuration>
</plugin>
Out of the box this won't work in Eclipse with m2e, so you'll have to add the following inside the POM <build> section:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<versionRange>[1.2,)</versionRange>
answered 2013-05-21T16:57:24.403