On 14/11/2014 18:14, Matt Newell wrote: > Greetings, > > I have a need to get version information for classes that I have been > packaged in a war, and loaded into Tomcat 7.0.trunk on Windows 7. For > example: > > > System.out.println(this.getClass().getPackage().getImplementationVersion()); > > Assuming my.war/META-INF/MANIFEST.MF: > Manifest-Version: 1.0 > Implementation-Version: 1.0 > > getImplementationVersion() always returns null. > > If I review the code for WebappClassLoader the reason for this is clear. > All roads lead to findResourceInternal(File, String), line 2983 in > 7.x/trunk. This method makes no attempt to load the manifest from the war. > > My first instinct was that this is a bug. However, I did a quick check > using the same scenario using Wildfly 8 and the behavior is the same. Given > the clarity of the Tomcat code, and that two robust, well-tested platforms > behave the same, I have to assume this is intentional.
Probably not. My guess is that the Tomcat developers didn't implement it because they didn't have a need for it. > My question is this: why? I'm fairly sure the Wildfly Servlet container is a fork of Tomcat - hence the commonality. > Is META-INF/MANIFEST.MF not part of the war standard? It looks like it is to me. > I've googled, but am not enough of a java standards wonk to know > what docs are authoritative on this topic. I've certainly seen examples > that use it. I think this is worth opening a bug for. I am a little concerned about the overhead that may be required for this. It might end up as WONTFIX. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org