Uploaded image for project: 'Maven JAR Plugin'
  1. Maven JAR Plugin
  2. MJAR-1

Manifest generation problems caused by valid POM information

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1
    • None
    • None

    Description

      It looks like we have some problems with the contents of manifests in jar files.

      According to Sun's documentation (http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html), there are three basic formatting rules which are not always being enforced:
      1) All text must be UTF-8
      2) Lines are limited to 72 characters; longer lines must be continued
      3) Sections are divided by blank lines

      Where are these rules being violated? The first rule can be violated by any POM which is in a character set other than UTF-8. The last two rules can be violated by any POM value which spans multiple lines. Both of these are potential problems since a number of POM values go directly into the manifest without sufficient checking.

      Example:
      The plugin I have been working on suddenly stopped working. It stopped when I added a two-line description to the POM. I have been able to determine that converting the second line of the description into a proper manifest continuation line fixed the problem. As it turns out, the class loader was ignoring the jar; this created an error where the name of the Mojo class was found but the class could not be loaded.

      Workarounds for the present:
      – Any POM fields which end up in a jar manifest needs to be limited to UTF-8 characters.
      – Multi-line values should be constructed so that all lines start with a space character (not strictly required for the first line but it doesn't hurt).

      Attachments

        1. MNG-1558-plexus-archiver.patch
          4 kB
          Edwin Punzalan

        Activity

          People

            jdcasey John Dennis Casey
            allisonb Bob Allison
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: