Manifest generation problems caused by valid POM information
------------------------------------------------------------

         Key: MNG-1558
         URL: http://jira.codehaus.org/browse/MNG-1558
     Project: Maven 2
        Type: Bug
  Components: maven-jar-plugin  
    Versions: 2.0    
    Reporter: Bob Allison


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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to