Libraries with an official version number often have it embedded in the filename.
For build info, you should have an automated build process anyway, and it most likely uses ant. It is easy to:
- For jar files, you can set the implementation attributes in the manifest files.
- You can create a propertyfile located in the classpath which contain the information you wish to propagate. Often you want the build time and who built it.
- For web applications you can put it in the description located in web.xml.
You can display this information in several ways:
- The description of a web app is often easily visible in the deployment environment.
- A build page showing the components used to build.
- Logging the build information to the servlet log at start up time.
The essential question here is who needs to see it? End users cannot see in logs...
Also do not underestimate the value of an accurately kept deployment log! You should not have to go and look at the consumers files...