Thursday, February 2, 2012

Date Time for Maven Builds

Print/View Datetime stamp in Maven
Since Maven 2.1 M1 version, here is how you can get the datetime stamp while using maven build scripts:
Define a property named "maven.build.timestamp.format" with some legitimate value i.e. "yyyyMMdd.HHmm" and property named "maven.build.timestamp" will be available to use.

Example here:



<properties>
<maven.build.timestamp.format>yyyyMMdd.HHmm</maven.build.timestamp.format>
<CurrentDateTime>${maven.build.timestamp}</CurrentDateTime>
</properties>

No comments: