From a Java application I can log a string, using a custom logging framework, as follows:
logger.info("Version 1.2 of the application is currently running");
Therefore when a user sends me a log file I can easily see what version of the application they are running.
The problem with the code above is that the version is hardcoded in the string literal and someone needs to remember to update it for every release. It's fairly inevitable that updating this string could be forgotten for a release.
What I would like to do is have this string literal automatically updated based on one of the version numbers in the manifest file for the application's JAR:
Specification-Version: 1.2
Implementation-Version: 1.2.0.0
I don't mind if this happens at compile time or at runtime as long as the version number gets into the log file.