jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Shared Components
  • MSHARED-99

Archiver should validate manifest attribute names.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: maven-archiver-2.5
  • Component/s: maven-archiver
  • Labels:
    None

Description

I noticed that the jar plugin and maven archiver will allow you to use an invalid attribute name in your manifest. According the jar specification, attribute names can only contain letters, numbers, dash, or underscore [1]. Currently if you put an attribute name like "my.attribute" in the manifest configuration of the jar plugin, the attribute will be added to your jar manifest. If you then try to use this jar file in your classpath, for example as a dependency of another project, you will get a compilation error:

[INFO] Compilation failure
error: error reading /home/me/.m2/repository/org/company/my-project/1.0-SNAPSHOT/my-project-1.0-SNAPSHOT.jar; invalid header field name: my.attribute

The archiver or the jar plugin should do a regex check to make sure that you are using a valid attribute name. And if not, a warning or error should be produced.

[1] http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Name-Value%20pairs%20and%20Sections

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MSHARED-134 Using ${artifcactId}-Extention-Name in MANIFEST file can create invalid MANIFEST files

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Bug - A problem which impairs or prevents the functions of the product. PLXCOMP-39 better validation of manifest entries in plexus-archiver

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Kristian Rosenvold added a comment - 24/Jan/12 5:37 AM

Plexus-archiver 2.1 uses the jdk manifest class, which barfs loudly about illegal attributes

Show
Kristian Rosenvold added a comment - 24/Jan/12 5:37 AM Plexus-archiver 2.1 uses the jdk manifest class, which barfs loudly about illegal attributes

People

  • Assignee:
    Kristian Rosenvold
    Reporter:
    Paul Gier
Vote (0)
Watch (1)

Dates

  • Created:
    26/Mar/09 11:51 AM
    Updated:
    24/Jan/12 5:37 AM
    Resolved:
    24/Jan/12 5:37 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.