iheartradio / play-swagger

Swagger spec generator for play framework
Apache License 2.0
403 stars 131 forks source link

java.util.zip.ZipException: duplicate entry: public/swagger.json #550

Open Dogacel opened 1 year ago

Dogacel commented 1 year ago

I am using the sbt plugin and I am having issues when it is being used with sbt remoteCache plugin.

[error] java.util.zip.ZipException: duplicate entry: public/sbt-swagger.json
[error]     at java.base/java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:233)
[error]     at java.base/java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:109)
[error]     at sbt.io.IO$.addFileEntry$1(IO.scala:709)
[error]     at sbt.io.IO$.$anonfun$writeZip$6(IO.scala:718)
[error]     at sbt.io.IO$.$anonfun$writeZip$6$adapted(IO.scala:718)
[error]     at scala.collection.immutable.List.foreach(List.scala:431)
[error]     at sbt.io.IO$.writeZip(IO.scala:718)
[error]     at sbt.io.IO$.$anonfun$archive$2(IO.scala:668)
[error]     at sbt.io.IO$.$anonfun$archive$2$adapted(IO.scala:665)
[error]     at sbt.io.IO$.$anonfun$withZipOutput$1(IO.scala:765)
[error]     at sbt.io.IO$.$anonfun$withZipOutput$1$adapted(IO.scala:745)
[error]     at sbt.io.Using.apply(Using.scala:27)
[error]     at sbt.io.IO$.withZipOutput(IO.scala:745)
[error]     at sbt.io.IO$.archive(IO.scala:665)
[error]     at sbt.io.IO$.jar(IO.scala:630)
[error]     at sbt.Package$.makeJar(Package.scala:228)
[error]     at sbt.Package$.$anonfun$apply$4(Package.scala:151)
[error]     at sbt.Package$.$anonfun$apply$4$adapted(Package.scala:149)
[error]     at sbt.util.Tracked$.$anonfun$outputChangedW$1(Tracked.scala:128)
[error]     at sbt.Package$.apply(Package.scala:161)
[error]     at sbt.Defaults$.$anonfun$packageTask$1(Defaults.scala:1860)
[error]     at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]     at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]     at sbt.Execute.work(Execute.scala:291)
[error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]     at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]     at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error]     at java.base/java.lang.Thread.run(Thread.java:829)
[error] (Compile / packageBin) java.util.zip.ZipException: duplicate entry: public/sbt-swagger.json
[error] Total time: 170 s (02:50), completed Mar 9, 2023, 11:58:13 AM

Edit: I run find . | grep swagger.json and here is the result:

./target/scala-2.12/classes/public/sbt-swagger.json
./target/swagger/sbt-swagger.json

Why do I have it in two different places?

Javakky-pxv commented 1 year ago

@Dogacel Thank you for your comment. Unfortunately, I am not using remoteCache, so it seems that I cannot dedicate much time to investigate here. If you could open a PR or provide a sample project that requires remoteCache, there is a possibility that the investigation can proceed faster.