test
test

Reputation: 51

Adding custom tags to jar manifest

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?

Upvotes: 5

Views: 6075

Answers (2)

T-Bull
T-Bull

Reputation: 2146

You can write pretty much whatever you want in your manifest file as long as you obey the format. So, what is your question really?

Upvotes: 1

Andrew Thompson
Andrew Thompson

Reputation: 168825

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

Upvotes: 7

Related Questions