You use CVS and tag your stuff every release right? But it can be a pain for your clients to get at your version info in your jar file once it’s out there in the wild.
I’ve tried a couple of ways. You can use jar manifest entries for Implementation-Version
or you can call your jar myjar-1.2.3.jar
. The former is not very accessible for clients to get to, the later can be a pain for clients since they can’t just drop in the new jar as a replacement cause their IDE may barf. I’ve found neither is ideal.
I’ve recently come across JReleaseInfo which seems to be a nice little solution. This little bad boy runs as an Ant task, and embeds your specified version info along with a tiny Swing viewer right inside your jar. Add a Main-Class
entry to your jar Manifest, and you’ve got yourself a self-executing jar that displays a nice GUI deal with all your vital signs. Check out the grab on their site.
Looks like holding a lot of promise. Doesn’t support commandline output at the moment (which would be nice for Unix boxes that you’ve only got ssh to), but I’ve submitted a feature request and the boys think it could be doable. Check out the screen grabs. It’s pretty impressive, and clients just love double clicking on stuff. Elegant.