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/).