Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse maven-jar-plugin not signing, because of duplicate entries pom.xml and pom.properties only on Windows

I searched a lot, but I have not found any solution for this.

Environment

*** Eclipse Java EE IDE for Web Developers. Version: Kepler Release - Build id: 20130614-0229 with m2e-wtp - Maven Integration for WTP
1.0.0.20130612-1742 
*** Windows 7 up to date
*** Java SDK 1.7.0-40
*** Maven: Embedded (3.0.4/1.4.0.20130531-2315)

Problem

Errors:

Signing jars with (apache)maven-jar-plugin:2.4:sign (signing) on Linux works fine! The same maven project on Windows leads to the following error:

[INFO] jar is unsigned. (signatures missing or not parsable)
[ERROR] jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: META-INF/maven/.../pom.xml

Other messages:

I spotted different outputs between Linux and Windows from (apache)maven-jar-plugin:2.4:jar (default-jar)

Linux-Eclipse skips both files, because were already added:

...
[INFO] META-INF/maven/com.xyz/abc-client/pom.xml already added, skipping
[INFO] META-INF/maven/com.xyz/abc-client/pom.properties already added, skipping
...

after that the signing works fine!

The Windows ouput is not showing these two lines!!

Additional Information:

  • I can not use the (apache)maven-jarsigner-plugin, because it will lead to following error - without solution:

    [ERROR] jarsigner: cannot rename file jarfile.jar to .orig`
    
  • This github-forum website tells me that the m2e-wtp-plugin of Eclipse causing the problem, and that I should use maven on command line .... this is the absolutely last option to use!!!

  • There is also a bug "MPIR-286" on codehouse for this, but still unresolved.
  • The clean part is done by the plugin and it's the same configuration for a client-module build before the one causing the problem.

Question:

Is there a possibility to get rid of this error? I cannot use the jarsigner-plugin, because of the "rename"-error and not the jar-plugin, because of the "duplicate entry"-error ... that is in fact a very strange situation.

like image 702
marmelin Avatar asked Sep 23 '13 10:09

marmelin


1 Answers

In my case maven clean install fixed this issues

Make use of this Java Decompiler for Viewing the jar whether it has a Duplicate pom.xml and properties

like image 188
RAJESH KUMAR ARUMUGAM Avatar answered Sep 28 '22 13:09

RAJESH KUMAR ARUMUGAM