Skip to content

Commit fde545d

Browse files
committed
use AsNeeded for Zip64; AlwaysWithCompatibility has issues with large files
1 parent 19d7876 commit fde545d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/org/skife/waffles/ReallyExecutableJarMojo.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
package org.skife.waffles;
1515

1616
import org.apache.commons.compress.archivers.jar.JarArchiveOutputStream;
17-
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
18-
import org.apache.commons.compress.archivers.zip.ZipArchiveEntryPredicate;
17+
import org.apache.commons.compress.archivers.zip.Zip64Mode;
1918
import org.apache.commons.compress.archivers.zip.ZipFile;
2019
import org.apache.maven.artifact.Artifact;
2120
import org.apache.maven.plugin.AbstractMojo;
@@ -46,7 +45,6 @@
4645
import static java.nio.charset.StandardCharsets.US_ASCII;
4746
import static java.nio.charset.StandardCharsets.UTF_8;
4847
import static java.nio.file.Files.readAllBytes;
49-
import static org.apache.commons.compress.archivers.zip.Zip64Mode.AlwaysWithCompatibility;
5048

5149
/**
5250
* Make an artifact generated by the build really executable. The resulting artifact
@@ -177,7 +175,7 @@ private void makeExecutable(File file)
177175
Files.move(file.toPath(), original);
178176
try (JarArchiveOutputStream jar = new JarArchiveOutputStream(Files.newOutputStream(file.toPath()))) {
179177
jar.writePreamble(getPreamble(original.toUri()));
180-
jar.setUseZip64(AlwaysWithCompatibility);
178+
jar.setUseZip64(Zip64Mode.AsNeeded);
181179
jar.setEncoding(UTF_8.name());
182180

183181
try (ZipFile zip = new ZipFile(original.toFile())) {

0 commit comments

Comments
 (0)