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 ?
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 ?
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.