You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2013/12/16 17:57:15 UTC

[jira] [Updated] (UIMA-2966) m2e builds potential conflict when doing Jars with maven

     [ https://issues.apache.org/jira/browse/UIMA-2966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marshall Schor updated UIMA-2966:
---------------------------------

    Description: 
The m2e integration in Eclipse for Maven does incremental builds as needed.  One side effect of these is to create in target/classes/META-INF/maven/[groupId]/[artifactId] the two files: pom.xml and pom.properties.

When the normal Maven Jar plugin runs, it uses an archiver configuration which (by default) has the addMavenDescriptor set to true.  This causes the archiver 1) archive everything in target/classes (including the META-INF/... that m2e may have built), and then it adds its own pom.xml and pom.properties, in the same place as the m2e did.

The result is the zip file has a directory that actually has 2 copies of these two files.

(Note, this won't happen if you build from the command line using "mvn clean install" - the "clean" step will delete the target/ before building).

Normally, having multiple files in a directory inside a Jar doesn't matter to anyone.  However, the build for Eclipse Update Sites runs the packager which includes (re)packing the Jar files to compress better, and this, in turn, runs some Zip thing which throws an exception if it finds 2 files with the same name in a directory.

The easy workaround is to always use mvn clean before install.

It should be easy to fix this, though - by having a step run ahead of the Jar plugin which deletes these two files (if they exist).  I think that would be "safer" in that things would always work...  Right now, if by chance you forget to do clean, and are using m2e, the Jars get built in this funny way, and nothing notices, until much later, if you try and include these Jars as part of "runtime" Jar in an Eclipse Update site.

It's not just the eclipse plugin jars; any jars included in the runtime (e.g. uimaj-core, uimaj-cpe, uimaj-tools, etc.) also must have this cleanup because the pack200 is run on those too.  

  was:
The m2e integration in Eclipse for Maven does incremental builds as needed.  One side effect of these is to create in target/classes/META-INF/maven/[groupId]/[artifactId] the two files: pom.xml and pom.properties.

When the normal Maven Jar plugin runs, it uses an archiver configuration which (by default) has the addMavenDescriptor set to true.  This causes the archiver 1) archive everything in target/classes (including the META-INF/... that m2e may have built), and then it adds its own pom.xml and pom.properties, in the same place as the m2e did.

The result is the zip file has a directory that actually has 2 copies of these two files.

(Note, this won't happen if you build from the command line using "mvn clean install" - the "clean" step will delete the target/ before building).

Normally, having multiple files in a directory inside a Jar doesn't matter to anyone.  However, the build for Eclipse Update Sites runs the packager which includes (re)packing the Jar files to compress better, and this, in turn, runs some Zip thing which throws an exception if it finds 2 files with the same name in a directory.

The easy workaround is to always use mvn clean before install.

It should be easy to fix this, though - by having a step run ahead of the Jar plugin which deletes these two files (if they exist).  I think that would be "safer" in that things would always work...  Right now, if by chance you forget to do clean, and are using m2e, the Jars get built in this funny way, and nothing notices, until much later, if you try and include these Jars as part of "runtime" Jar in an Eclipse Update site.


> m2e builds potential conflict when doing Jars with maven
> --------------------------------------------------------
>
>                 Key: UIMA-2966
>                 URL: https://issues.apache.org/jira/browse/UIMA-2966
>             Project: UIMA
>          Issue Type: Improvement
>          Components: Build, Packaging and Test
>    Affects Versions: parent-pom-4
>            Reporter: Marshall Schor
>            Assignee: Marshall Schor
>            Priority: Minor
>             Fix For: parent-pom-5
>
>
> The m2e integration in Eclipse for Maven does incremental builds as needed.  One side effect of these is to create in target/classes/META-INF/maven/[groupId]/[artifactId] the two files: pom.xml and pom.properties.
> When the normal Maven Jar plugin runs, it uses an archiver configuration which (by default) has the addMavenDescriptor set to true.  This causes the archiver 1) archive everything in target/classes (including the META-INF/... that m2e may have built), and then it adds its own pom.xml and pom.properties, in the same place as the m2e did.
> The result is the zip file has a directory that actually has 2 copies of these two files.
> (Note, this won't happen if you build from the command line using "mvn clean install" - the "clean" step will delete the target/ before building).
> Normally, having multiple files in a directory inside a Jar doesn't matter to anyone.  However, the build for Eclipse Update Sites runs the packager which includes (re)packing the Jar files to compress better, and this, in turn, runs some Zip thing which throws an exception if it finds 2 files with the same name in a directory.
> The easy workaround is to always use mvn clean before install.
> It should be easy to fix this, though - by having a step run ahead of the Jar plugin which deletes these two files (if they exist).  I think that would be "safer" in that things would always work...  Right now, if by chance you forget to do clean, and are using m2e, the Jars get built in this funny way, and nothing notices, until much later, if you try and include these Jars as part of "runtime" Jar in an Eclipse Update site.
> It's not just the eclipse plugin jars; any jars included in the runtime (e.g. uimaj-core, uimaj-cpe, uimaj-tools, etc.) also must have this cleanup because the pack200 is run on those too.  



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)