Using maven get compiled *.war file, which contains:
- META-INF
- - MANIFEST.MF
- WEB-INF
- - classes
- - lib
- - web.xml
Using java.util.jar.Manifest I want to read the manifest file to get application version from there like in https://stackoverflow.com/a/21046257/1728511
But Application.class.getResourceAsStream("/META-INF/manifest.mf")
returns null
.
Application.class.getResource( "" ).getFile()
returns %WAR%/WEB-INF/lib/javax.ws.rs-api-2.0.jar!/javax/ws/rs/core/
Using Spring, I've implemented ApplicationContextAware interface to get ApplicationContext instance.
And applicationContext.getClassLoader().getResourceAsStream( "" )
returns %WAR%/WEB-INF/classes
.
But I don't need WEB-INF
, I need META-INF
directory. How to get it?