1

Whenever we create a Dynamic Web Project in Eclipse,we can see that under

/WebContent/META-INF

a file is created called MANIFEST.MF. What is the use of MANIFEST.MF file in the project ?

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
Surajit Biswas
  • 779
  • 7
  • 25
  • @Seelenvirtuose I think this is a different question asking for the specific role of a MANIFEST.MF in a web application – wero Nov 27 '15 at 07:46
  • 1
    @wero But reading the answers and hyping into the provided links will teach him what a manifest file is for. He then will realize that this file is no different for JARs and WARs (and other xARs). This question thus is not useful as there are many articles about this topic (incl. SO questions). – Seelenvirtuose Nov 27 '15 at 07:51

1 Answers1

2

The files under WebContent are ready to be packaged into a WAR file for deployment on a servlet container.

The Servlet spec mentions a role for META-INF/MANIFEST.MF in chapter "10.7.1 Dependencies On Extensions":

Application developers need to know what extensions are installed on a Web container, and containers need to know what dependencies servlets in a WAR have on such libraries in order to preserve portability. The application developer depending on such an extension or extensions must provide a META-INF/MANIFEST.MF entry in the WAR file listing all extensions needed by the WAR.

The format of the manifest entry should follow standard JAR manifest format. During deployment of the Web application, the Web container must make the correct versions of the extensions available to the application following the rules defined by the Optional Package Versioning mechanism.

So the information of the MANIFEST.MF may be evaluated and needed by the container. But the spec is not very detailled about the nature of these extensions.

wero
  • 32,544
  • 3
  • 59
  • 84