Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-2966

m2e builds potential conflict when doing Jars with maven

    XMLWordPrintableJSON

Details

    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.

      Attachments

        Activity

          People

            schor Marshall Schor
            schor Marshall Schor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: