Create a file in src/main/resources. Its name can be whatever
It could contain:
the.application.version = ${project.version}
the.application.build.time = ${maven.project.timestamp}
Then, in the pom.xml, you should have in the build tag:
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
The filtering to true is the magic that converts ${project.version} to the real deal project version.
We could've used maven.build.timestamp in the whatever
<maven.project.timestamp>${maven.build.timestamp}</maven.project.timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>