I have a requirement wherein I wanted to put some user defined tags in jar manifest file. I was wondering if it is possible to do so?
To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool's m option to add the information in your file to the manifest. Warning: The text file from which you are creating the manifest must end with a new line or carriage return.
The manifest file is named MANIFEST. MF and is located under the META-INF directory in the JAR. It's simply a list of key and value pairs, called headers or attributes, grouped into sections.
I was wondering if it is possible to do so?
Yes.
If yes, any example?
silly-word: supercalafragilisticexpyaladocious
Custom enough for you?
See specifically the JAR File Specification: Manifest Specification for details on attributes and values.
- manifest-file: main-section newline *individual-section
- main-section: version-info newline *main-attribute
- version-info: Manifest-Version : version-number
- version-number : digit+{.digit+}*
- main-attribute: (any legitimate main attribute) newline
- individual-section: Name : value newline *perentry-attribute
- perentry-attribute: (any legitimate perentry attribute) newline
- newline : CR LF | LF | CR (not followed by LF)
- digit: {0-9}
In the above specification, attributes that can appear in the main section are referred to as main attributes, whereas attributes that can appear in individual sections are referred to as per-entry attributes. Certain attributes can appear both in the main section and the individual sections, in which case the per-entry attribute value overrides the main attribute value for the specified entry. The two types of attributes are defined as follows. ..
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