Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.zip.ZipException: duplicate entry with .m2 and .ivy2 #293

Open
tekener opened this issue Sep 1, 2015 · 5 comments
Open

java.util.zip.ZipException: duplicate entry with .m2 and .ivy2 #293

tekener opened this issue Sep 1, 2015 · 5 comments

Comments

@tekener
Copy link

tekener commented Sep 1, 2015

We are running into a problem in case that a lib exists in the .m2 and .ivy2 directory. The workaround is to delete the lib in one of the directories.

The exception:

[debug] Webapp resources directory: /e42/buildagent/work/b05723c0abf935c6/app/war
[debug] Embedding /e42/buildagent/work/b05723c0abf935c6/app/war/WEB-INF/web.xml -> /WEB-INF/web.xml
java.util.zip.ZipException: duplicate entry: WEB-INF/lib/org.apache.commons.commons-lang3-3.1.jar
    at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:233)
    at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
    at sbt.IO$.sbt$IO$$addFileEntry$1(IO.scala:445)
    at sbt.IO$$anonfun$sbt$IO$$writeZip$2.apply(IO.scala:454)
    at sbt.IO$$anonfun$sbt$IO$$writeZip$2.apply(IO.scala:454)
    at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at sbt.IO$.sbt$IO$$writeZip(IO.scala:454)
    at sbt.IO$$anonfun$archive$1.apply(IO.scala:410)
    at sbt.IO$$anonfun$archive$1.apply(IO.scala:408)
    at sbt.IO$$anonfun$withZipOutput$1.apply(IO.scala:498)
    at sbt.IO$$anonfun$withZipOutput$1.apply(IO.scala:485)
    at sbt.Using.apply(Using.scala:24)
    at sbt.IO$.withZipOutput(IO.scala:485)
    at sbt.IO$.archive(IO.scala:408)
    at sbt.IO$.jar(IO.scala:392)
    at com.github.play2war.plugin.Play2WarCommands$$anonfun$1.apply(Play2WarCommands.scala:219)
    at com.github.play2war.plugin.Play2WarCommands$$anonfun$1.apply(Play2WarCommands.scala:50)

The debug trace of the war plugin:

[debug] Embedding file /home/teamcity-bui/.m2/repository/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar -> WEB-INF/lib/org.apache.commons.commons-lang3-3.1.jar
[debug] Embedding file /home/teamcity-bui/.ivy2/cache/org.apache.commons/commons-lang3/jars/commons-lang3-3.1.jar -> WEB-INF/lib/org.apache.commons.commons-lang3-3.1.jar
@dlecan
Copy link
Member

dlecan commented Sep 1, 2015

Do you know why commons-lang3 is present twice in classpath ? (Ivy and M2 dependencies)

@tekener
Copy link
Author

tekener commented Sep 1, 2015

I don't have a glue. The build servers are also running maven builds. Thats why we have the jar in both directories. But i don't know why sbt puts the jar twice into the classpath.

@dlecan
Copy link
Member

dlecan commented Sep 1, 2015

Can you precise:

  • SBT version
  • Play2war version

Thanks

@tekener
Copy link
Author

tekener commented Sep 1, 2015

SBT: 0.13.9
Play2war: 1.3-beta3

Thanks

@tekener
Copy link
Author

tekener commented Sep 9, 2015

There is a similar bug in sbt: sbt/sbt-native-packager#657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants