I can confirm that with Maven 3.x {maven.build.timestamp} now "works." Apparently, they are working on this problem. No additional properties are required.
However, be careful, your maven-resources-plugin has been updated. It should be relatively new, so if mvn help:effective-pom shows the old version (for example, 2.6), increase it to something newer, fix 3.x ex for me:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>3.1.0</version> </plugin>
<properties><timestamp>... workaround is no longer required ...
It also made it clear, for some reason, why it worked in IntelliJ and not on the command line. IntelliJ probably uses its own "modified / internal" maven constants, so it worked there, but not from the maven command line.
Also note that if you add a filtering resources directory to your pom, you may also need to βre-addβ the default directory, it is lost, for example:
<resource> <directory>src/main/resources-filtered</directory> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources</directory> </resource>
Note: if you use spring loading as a parent, you should use @ maven.build.timestamp @ instead . Also note that if you use spring boot, there is a META-INF/build-info.properties which, optionally, creates a spring-boot-maven-plugin that you can read (for readability, BuildProperties provides the BuildProperties component of the BuildProperties ).
rogerdpack Oct 23 '18 at 0:07 2018-10-23 00:07
source share