I was wondering if there is any standard procedure to set a Java project's version (a bit like a Windows executable file version).

I'd like to have my application's code able to have introspection capabilities so it can know its own version.

Is it possible, at all, to do this with Java without resorting to have a .txt file in the directory with the version as contents?

If yes, the ideal would be to have Eclipse update the version each time it is compiled. Is this possible?