This repository was archived by the owner on Apr 4, 2026. It is now read-only.
java.util.zip.ZipException when explodedJar := true on multiproject setup#215
Merged
Conversation
dlecan
added a commit
that referenced
this pull request
Jan 29, 2014
FIx java.util.zip.ZipException when explodedJar := true on multiproject setup
Member
|
Do you really need this fix for Play 2.1.x series ? |
Contributor
Author
|
Yes, using the develop-2.1.x branch was intentional as the project I needed this for is still using that version of Play. (We're only waiting for the play2war plugin 1.2-beta2 to become a stable version to switch to Play 2.2, I might add.) The change should be fairly easy to migrate to the other branches, though. Shall I create pull request for the develop branch? |
Member
Not necessary, I will cherry-pick it :) |
Member
|
Play2War v1.0.2 with a fix for this issue is out! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pull request fixes the following issue for Play 2.1.x:
> play war [info] Loading project definition from D:\dev\myproject\project This project uses Play 2.1.3! Update the Play sbt-plugin version to 2.1.4 (usually in project/plugins.sbt) [info] Loading project definition from D:\dev\myproject\modules\admin\project [info] Loading project definition from D:\dev\myproject\modules\common\project [info] Loading project definition from D:\dev\myproject\modules\web\project [info] Set current project to myproject (in build file:/D:/dev/myproject/) [info] Wrote D:\dev\myproject\modules\common\target\scala-2.10\common_2.10-2.2.pom [info] Wrote D:\dev\myproject\modules\web\target\scala-2.10\web_2.10-2.2.pom [info] Wrote D:\dev\myproject\modules\admin\target\scala-2.10\admin_2.10-2.2.pom [info] Wrote D:\dev\myproject\target\scala-2.10\myproject_2.10-2.2.pom [info] Build WAR package for servlet container: 2.5 [info] Packaging D:\dev\myproject\target\myproject-2.2.war ... [info] Main artifacts 'common_2.10-2.2.jar web_2.10-2.2.jar admin_2.10-2.2.jar myproject_2.10-2.2.jar' will be packaged exploded [info] WEB-INF/web.xml found. java.util.zip.ZipException: duplicate entry: WEB-INF/classes/META-INF/MANIFEST.MF at java.util.zip.ZipOutputStream.putNextEntry(Unknown Source) at java.util.jar.JarOutputStream.putNextEntry(Unknown Source) at sbt.IO$.addFileEntry$1(IO.scala:441) at sbt.IO$$anonfun$sbt$IO$$writeZip$2.apply(IO.scala:450) at sbt.IO$$anonfun$sbt$IO$$writeZip$2.apply(IO.scala:450) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) at sbt.IO$.sbt$IO$$writeZip(IO.scala:450) at sbt.IO$$anonfun$archive$1.apply(IO.scala:403) at sbt.IO$$anonfun$archive$1.apply(IO.scala:401) at sbt.IO$$anonfun$withZipOutput$1.apply(IO.scala:496) at sbt.IO$$anonfun$withZipOutput$1.apply(IO.scala:482) at sbt.Using.apply(Using.scala:25) at sbt.IO$.withZipOutput(IO.scala:482) at sbt.IO$.archive(IO.scala:401) at sbt.IO$.jar(IO.scala:384) at com.github.play2war.plugin.Play2WarCommands$$anonfun$1.apply(Play2WarCommands.scala:204) at com.github.play2war.plugin.Play2WarCommands$$anonfun$1.apply(Play2WarCommands.scala:55) at sbt.Scoped$$anonfun$hf14$1.apply(Structure.scala:590) at sbt.Scoped$$anonfun$hf14$1.apply(Structure.scala:590) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49) at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311) at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41) at sbt.std.Transform$$anon$5.work(System.scala:71) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) at sbt.Execute.work(Execute.scala:238) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160) at sbt.CompletionService$$anon$2.call(CompletionService.scala:30) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) [error] (myproject/*:war) java.util.zip.ZipException: duplicate entry: WEB-INF/classes/META-INF/MANIFEST.MF [error] Total time: 19 s, completed 2014.01.11. 8:14:22I checked the file list generated by the plugin that's passed to the IO.jar(...) call. It had 4 entries like this, one for each subproject and one for the parent:
Additionally, any files that are on the same classpath are duplicated in the file list, too. I understand that such files will not be accessible at runtime, but they can still be useful, e.g. an empty application.conf file should exist in all subprojects as various tools use its presence to recognize the project as a Play project.