boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 181 forks source link

Boot-generated uberjar zip file has corrupted content on Java 13 #752

Open shaunr0b opened 4 years ago

shaunr0b commented 4 years ago

Describe the bug The JAR file produced by boot build when used in the default way produces a zip containing a corrupt metadata file (META-INF/MANIFEST.MF)

To Reproduce Steps to reproduce the behavior:

  1. Create a new boot project

    boot -d boot/new new -t app -n myapp
    cd myapp
    boot run
  2. Run boot build to generate a jar

  3. Use unzip command to unzip the jar unzip target/myapp-0.1.0-SNAPSHOT-standalone.jar

Expected behavior The jar file should unzip without error.

Actual The JAR fails to unzip on this file:

    inflating: META-INF/MANIFEST.MF   bad CRC bd07333f  (should be 5fbe64cb)

Desktop (please complete the following information):

Additional context

casphas commented 4 years ago

This is probably related to [https://bugs.openjdk.java.net/browse/JDK-8233457]: "Writing out data with ZipFileSystem leads to a CRC failure in the generated jar file".

I noticed the same problem with JDK 11 starting with 11.0.4. The OpenJDK bug states that this is also present in JDK 13. Reverting to JDK 11.0.3 or JDK 8 worked for me. The fix is in JDK 11.0.6 and JDK 14 if I read the OpenJDK ticket correctly.