role of META-INF directory
Asked Answered
P

1

5

current spring-mvc webapp (also saw it in another primefaces webapp) webapplication directory structure:

webapp
|
|_src
|
|_WebContent
  |
  |__WEB-INF
  |
  |__META-INF
     |
     |__MANIFEST.MF

Always saw and MANIFEST.MF file in META-INF directory. Some times, it seems nothing else would happen if I deleted them. what's the role of them?

~#:cat MANIFEST.MF

Manifest-Version: 1.0
Class-Path:
Parlour answered 24/6, 2013 at 9:3 Comment(2)
A META-INF directory is used in all sorts of applications, including zipped file formats like epub, open office and office open xml, so it would probably help if you mentioned what kind of web application you noticed this with. In most cases I've seen it's used to to tell an application what kind of use is intended for a ZIP file and typically includes metadata (just like it says on the tin) and possibly a manifest.Bonnee
possible duplicate of What's the purpose of META-INF?Beginner
E
12

For web, the META-INF directory is typically found in Java based webapplications such as jsp (Java server pages). You can also find them in Java related webservers such as Apache-Tomcat.

The file you mentioned:

MANIFEST.MF: The manifest file that is used to define extension and package related data. So mostly it can contain human readable info like version, producer,.. but also machine readable info like module dependencies in external frameworks you may be using

Everything inside META-INF:

The files/directories in the META-INF directory are recognized and interpreted by the Java Platform to configure applications, extensions, class loaders and services.

When you don't "deviate" of the normal path (eg: you have no additional frameworks,...), you don't need certain files and thus nothing happens if you delete them. Java will create a default manifest file with every application.

Electrolyse answered 24/6, 2013 at 9:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.