Archiver should validate manifest attribute names.
--------------------------------------------------
Key: MSHARED-99
URL: http://jira.codehaus.org/browse/MSHARED-99
Project: Maven Shared Components
Issue Type: Improvement
Components: maven-archiver
Reporter: Paul Gier
Priority: Minor
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
--
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