You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marshall Schor (JIRA)" <ji...@codehaus.org> on 2013/06/04 19:48:03 UTC

[jira] (MJAR-165) addMavenDescriptor action sometimes ends up with two copies of pom.xml and pom.properties

Marshall Schor created MJAR-165:
-----------------------------------

             Summary: addMavenDescriptor action sometimes ends up with two copies of pom.xml and pom.properties
                 Key: MJAR-165
                 URL: https://jira.codehaus.org/browse/MJAR-165
             Project: Maven 2.x JAR Plugin
          Issue Type: Bug
    Affects Versions: 2.3.2
            Reporter: Marshall Schor
            Priority: Minor


When the archiver is configured with a default configuration, it has its addMavenDescriptor property set to true.  This results in the files pom.properties and pom.xml being added into the Jar archive in the spot META-INF/maven/[groupId]/[artifactId]/. 

If you are developing using Eclipse and "m2e" integration, the m2e incremental builder creates these same two files in the spot target/classes/META-INF/maven/[groupId]/[artifactId]/.  

The Jar plugin, in this case, seems to add both of these to the Jar Archive.  You can actually see two different copies of these files in the same directory.

Most tooling doesn't care; and this won't happen if you do Maven building by using a "clean" before the processing, as it would erase everything that m2e stored in target/.

I've found one tool that does complain - it's a tool we run as part of building Eclipse update sites, and it complains when our structure has Jars contained within Jars.  

The workaround is to always run "clean" first.  Another workaround is to erase any versions of these files in target/classes/... before running the Jar command.

The proper fix I think would be to have the Jar plugin decide which versions of these files are the correct ones, and put that into the archive, only once.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira