[ http://jira.codehaus.org/browse/MJAR-39?page=comments#action_67413 ] 

Steven Coco commented on MJAR-39:
---------------------------------

Hi.

Well, simply, lines in the manifest cannot be longer than 72 bytes -- not 
characters, but UTF-8 encoded bytes.

So, if a given attribute value causes the first line of the name-value pair to 
exceed that, it needs to be broken across more than one line.  That's all.

To do that, the lines after the first must be preceeded with a single space -- 
not any whitespace, but only a single space character.  -- Presumably, if the 
attribute value so happens to contain some kind of white space at this 
location, only the first space character is stripped away and the remainder of 
the line is the continuing attribute value.

But then importantly also, the first blank line in the manifest separates the 
main attributes section from the rest, the per-entry attributes.  So Maven 
can't put any fully blank lines in the manifest's main section.  And it also 
can't do that in individual per-entry sections either.

But it will do that.

Does tht make sense?

I realized that I mixed up the posted test case; I posted a few issues at the 
same time and mixed files up, and this zip is not useful.  I'll see if I can 
attach a better test case: but if I fail, you can make a simple POM, and set 
the <description> attribute literally like this:

<description>
    This

   is a problem.
</description>

Then Maven will scoop this up and place it into the manifest as the 
"Specification Title", and it will include the blank line and all the rest.  
This Jar is then invalid.

The section in the Jar specification titled "Notes on Manifest and Signature 
Files" explains the line length and breaking long lines.

Thanks!!
- Steven Coco

> Maven Sets Manifest Attribute Values to Multi-Line Strings
> ----------------------------------------------------------
>
>          Key: MJAR-39
>          URL: http://jira.codehaus.org/browse/MJAR-39
>      Project: Maven 2.x Jar Plugin
>         Type: Bug

>     Versions: 2.0
>  Environment: Maven version: 2.0.4
> Microsoft Windows XP [Version 5.1.2600]
>     Reporter: Steven Coco
>  Attachments: Jar Specification-Title Tester.zip, MJAR-39.patch
>
>
>      Maven will set a Manifest attribute's value to a multi-line string, 
> which results in an invalid Manifest.
>      By default, on its own, Maven adds a Specification-Title attribute to 
> the Manifest, and sets its value to the POM's <description> element.  If this 
> is a multi-line value in the POM, Maven will insert it unchanged: and yield 
> an invalid Manifest.  Maven then can't even load the jar that it just created 
> itself!
>      I have filed another bug relating to the fact that it should not insert 
> such an attribute by default: MJAR-38

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

Reply via email to