I want to add a version numbering to my Java application (in this case a Vaadin Portlet) which features the Version number in the help view.
The thing is that that version number is the one defined in the my Maven's POM file (for example 1.1.5-SNAPSHOT) and that is the one we are going to change (at release for example).
Any idea on how to get it out of the POM and into (for example, a String) in Java? (If this is at all possible)
Thanks
Use a filtered properties file containing the line
version=${project.version}
and load this properties file from the classpath in your Java program.
There are many solutions to this problem
But I would defintely prefer the first, as accessing MANIFEST.MF is quite easy in Java
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With