You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2019/04/14 10:11:00 UTC

[jira] [Commented] (MSHARED-815) Maven Archiver: MavenArchiver.addManifestAttribute does not escape empty lines in value

    [ https://issues.apache.org/jira/browse/MSHARED-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16817269#comment-16817269 ] 

Konrad Windszus commented on MSHARED-815:
-----------------------------------------

To me it seems that the right thing to e.g. escape key "test" with value 
{code}
This is a paragraph

This is another paragraph
{code}
is
{code}
test: This is a paragraph
 
 This is another paragraph
{code}
There is a space in line 2!

> Maven Archiver: MavenArchiver.addManifestAttribute does not escape empty lines in value
> ---------------------------------------------------------------------------------------
>
>                 Key: MSHARED-815
>                 URL: https://issues.apache.org/jira/browse/MSHARED-815
>             Project: Maven Shared Components
>          Issue Type: Bug
>          Components: maven-archiver
>    Affects Versions: maven-archiver-3.4.0
>            Reporter: Konrad Windszus
>            Priority: Major
>
> According to https://docs.oracle.com/javase/10/docs/specs/jar/jar.html#name-value-pairs-and-sections
> {quote}
> Groups of name-value pairs are known as a "section". Sections are separated from other sections by empty lines.
> {quote}
> Therefore empty lines in attribute values lead to invalid manifests and must somehow be escaped.
> As this is not done by default in {{java.util.jar.Attributes.writeMain(...)}} the method {{MavenArchiver.addManifestAttribute(...)}} should either throw an exception in case of empty lines given to parameter {{value}} or escape those empty lines somehow (https://github.com/apache/maven-archiver/blob/d454ab3fcd147c0201a14f298cc8f9e1a25ba03e/src/main/java/org/apache/maven/archiver/MavenArchiver.java#L221).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)