The Java JAR Manifest file MANIFEST.MFA Java JAR may contain a file META-INF/Manifest.mf. This file contains metadata about the JAR itself. It can be automatically created by the build tool. Ant has special support for generating valid manifest files. Features
Advantages
Disadvantages
The difference between expected behaviour and actual behaviour is a recurrent source of support calls in Ant. [9258, 3811, 12496, 10960, 22530, 7079, 31251] Every so often, however, the reports are valid. There are also some ambiguities in interpretation that need to be resolved through bug reports and experimentation. These bug reports are interesting, as they show how a relatively simple specification can still be hard to read and write. Too many programs treat it as a simple Properties File, when in fact it is something much more complex, with line wrapping, duplicate Class-Path entries and UTF-8 encoding. It is notable that XML files do not cause such problems at parse time, because nobody tries to implement their own XML parser. In XML, the problems are raised up from line-wrapping issues to those of semantics. SmartFrog supportSmartFrog does not directly read or write manifest files. The sf-ant package can run the Ant <jar> and <manifest> tasks, which are the most thoroughly tested implementations on the planet outside Sun's own libraries. Anyone wishing to implement their own parser for the SmartFrog language is encourage to learn the lessons of the MANIFEST.MF file. Use the syntax file /org/smartfrog/sfcore/languages/sf/DefaultParser.jj as a basis of a parser, rather than try and reverse engineer the syntax from the English-language specification. Examplesant-launcher manifest Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7 Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.) Main-Class: org.apache.tools.ant.launch.Launcher This is a simple manifest with a main-class defined. ant manifest Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7 Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.) Main-Class: org.apache.tools.ant.Main Name: org/apache/tools/ant/ Extension-name: org.apache.tools.ant Specification-Title: Apache Ant Specification-Version: 1.7 Specification-Vendor: Apache Software Foundation Implementation-Title: org.apache.tools.ant Implementation-Version: 1.7 Implementation-Vendor: Apache Software Foundation This is the main JAR; it has added an extension specification and implementation. In the past, the JAR declared a dependency on Xerces in its manifest; this has been disabled now that adequate XML parsers are more common in the Java runtime. partial activation.jar manifest Manifest-Version: 1.0 Implementation-Version: 1.0.2 Specification-Title: JavaBeans(TM) Activation Framework Specification Specification-Version: 1.0 Extension-Name: javax.activation Created-By: 1.3.0 (Sun Microsystems Inc.) Implementation-Vendor-Id: com.sun Implementation-Vendor: Sun Microsystems, Inc. Specification-Vendor: Sun Microsystems, Inc. SCCS-ID: @(#)jaf.mf 1.1 02/03/15 Name: javax/activation/MimeTypeParseException.class SHA1-Digest: uxV3qLHRu5JTOFrHnJXm13AO+0M= Name: javax/activation/CommandInfo.class SHA1-Digest: 1cKS/VKDQRQtAdvjQSJXZfjuKnM= This manifest continues with a SHA1 digest for every class in the JAR. |