I am using maven 3.0.4 and would like to make the build timestamp accessible to my application. For this, I\'m putting a placeholder in a .properties file and l
Adding Maven properties at the pom project level doesn't take into account correct local Timezone, so timestamp may appear wrong :
${maven.build.timestamp}
Using the build-helper-maven-plugin applies the correct timezone and current daylight saving to the timestamp :
org.codehaus.mojo
build-helper-maven-plugin
1.9.1
timestamp-property
timestamp-property
timestamp
yyyy-MM-dd HH:mm:ss
Europe/Zurich
src/main/resources
true
When packaging, Maven will replace any token timestamp in /resources folder, e.g. resources/version.properties :
build.timestamp=${timestamp}
You can then load this properties file in your Application.