Adjust fat jar central directory to account for launch script
An upgrade to Apache Commons Compress allows the build plugins to write the launch script to the fat jar as a proper preamble, making the file compatible with more jar and zip tooling. Fixes gh-22336
This commit is contained in:
@@ -74,13 +74,12 @@ public class ZipFileTarArchive implements TarArchive {
|
||||
tar.finish();
|
||||
}
|
||||
|
||||
private void assertArchiveHasEntries(File jarFile) {
|
||||
try (ZipFile zipFile = new ZipFile(jarFile)) {
|
||||
Assert.state(zipFile.getEntries().hasMoreElements(), () -> "File '" + jarFile
|
||||
+ "' is not compatible with buildpacks; ensure jar file is valid and launch script is not enabled");
|
||||
private void assertArchiveHasEntries(File file) {
|
||||
try (ZipFile zipFile = new ZipFile(file)) {
|
||||
Assert.state(zipFile.getEntries().hasMoreElements(), () -> "Archive file '" + file + "' is not valid");
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new IllegalStateException("File '" + jarFile + "' is not readable", ex);
|
||||
throw new IllegalStateException("File '" + file + "' is not readable", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user