Tutorial by Examples

If you package your application in a jar using the maven-jar-plugin or the maven-assembly-plugin, an easy way to get the current pom version is to add an entry in the manifest, which is then available from Java. The secret is to set the addDefaultImplementationEntries flag to true (and the addDefau...
As this documentation explains, Sometimes a resource file will need to contain a value that can only be supplied at build time. To accomplish this in Maven, put a reference to the property that will contain the value into your resource file using the syntax ${<property name>}. The property ...
The other examples may be the best and most stable way to get a version number into an application statically. This answer proposes an alternative showing how to do it dynamically during runtime, using the maven maven-model library. Add the dependency: <dependency> <groupId>org.apac...

Page 1 of 1