0

This might be a duplicate question, but after trying almost all the possible solutions, I am still unable to read the correct manifest file in my war. here is how my war file looks like;

  • META-INF
    • maven/com.abc.pack/console
    • MANIFEST.MF
    • context.xml
  • WEB-INF
    • classes com.abc -configurations -MainController
    • lib -(multiple jars)

I want to access /META-INF/MANIFEST.MF at the root from the MainController class .

Used

getServletContext().getResourceAsStream("/META-INF/MANIFEST.MF")

and

this.getClass().getPackage().getImplementationVersion()

Both return null.

Tried several other solutions provided but it then read manifest file of the one of jars inside the lib folder but not the root.

Some solution also had the jcabi plugin to use read manifest but i want to try without a plugin support.

Can anyone help me find what I am doing wrong here?

CannedMoose
  • 509
  • 1
  • 10
  • 18
Prajakta
  • 89
  • 1
  • 9
  • Here is a duplicate question but cannot determine solution from answer https://stackoverflow.com/q/34289754/3248320 – Prajakta Apr 13 '18 at 09:33
  • Resolved. Above method is correct and My code was unable to fetch it since i was deploying the exploded war folders which did not contain manifest. The actual war when deployed generates this manifest file and is accessible using above methods. – Prajakta Apr 17 '18 at 09:10

0 Answers0