I am aware of usage of MANIFEST file in a mobile application, but am not aware of usage of same in a Java Application.
My guess say like, its being used to keep BUILD information only. Am I correct??
Is this Mandatory?If not, then what are the key benefits that we can draw with this?
What gives a JAR file this versatility? The answer is the JAR file's manifest. The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes.
manifest.mf carries attributes of the artifact. One of the most well known ones is for example the main class of the jar that is used to start the jar file when no other class is specified. Syntax: Main-Class: classname. Other purposes are, for example, package sealing and package versioning.
Manifest. MF contains information about the files contained in the JAR file. These are entries as “header:value” pairs. The first one specifies the manifest version and second one specifies the JDK version with which the JAR file is created.
You use the m command-line option to add custom information to the manifest during creation of a JAR file. This section describes the m option. The Jar tool automatically puts a default manifest with the pathname META-INF/MANIFEST. MF into any JAR file you create.
manifest.mf
carries attributes of the artifact. One of the most well known ones is for example the main class of the jar
that is used to start the jar file when no other class is specified. Syntax:
Main-Class: classname
Other purposes are, for example, package sealing and package versioning. Check out the java tutorial about it: http://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html
A manifest in a jar usually contains much less information than for example AndroidManifest.xml
. It is quite lightweight and does not contain any build or packaging information.
This is because java has no good module system. So, a jar is not a module which might need a lot of configuration information (like a list of modules to which it has dependencies). Instead, a jar is just a bunch of classes with some configuration information. Hopefully, this will be fixed by project jigsaw (http://openjdk.java.net/projects/jigsaw/).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With