This is kind of a ridiculous thing to do, but for some back-story we develop a number of java packages that become part of a large, unwieldy system. We have no control over the builds for this large system. We just check code into a subversion repo and jenkins takes over from there. The problem we've had in the past is that we have no indication that the code we checked in is actually running in any of the test or production environments. The group doing these builds is incompetent at best and can't seem to provide any real information. This continuous build environment does not lend itself to us changing minor version numbers every time a code change is made. And there are about a dozen packages so I'd prefer not to have to update version numbers in all those places all the time. (but I am prepared to accept that as the only viable solution if needed).
What I'd like to do, and this is completely pie-in-the-sky, is have maven do something as part of the building of our packages, where it generates a hash value based on all the *.java files in a package and outputs that value to a resource file which also gets picked up when packaged. The classes within these *.java files, when outputting log messages, will be able to append this hash value somewhere in the log string since the logging framework will read this hash value from this resources file. So at runtime, we can tell which "version" of our packages is actually running. This has its downsides for sure...
but part of me just wants to see if this will work. I'm fairly new to maven and I've been unsuccessful at searching for just the right thing in this case.
let the flames begin...