Marshall Schor created UIMA-2966:
------------------------------------
Summary: 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.
--
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