Merge branch '2.4.x' into 2.5.x

Closes gh-27535
This commit is contained in:
Scott Frederick
2021-07-30 13:50:56 -05:00
7 changed files with 162 additions and 1 deletions

View File

@@ -387,7 +387,13 @@ public class BuildImageMojo extends AbstractPackagerMojo {
public void writeTo(OutputStream outputStream) throws IOException {
TarArchiveOutputStream tar = new TarArchiveOutputStream(outputStream);
tar.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
this.packager.packageImage(this.libraries, (entry, entryWriter) -> write(entry, entryWriter, tar));
try {
this.packager.packageImage(this.libraries, (entry, entryWriter) -> write(entry, entryWriter, tar));
}
catch (RuntimeException ex) {
outputStream.close();
throw new RuntimeException("Error packaging archive for image", ex);
}
}
private void write(ZipEntry jarEntry, EntryWriter entryWriter, TarArchiveOutputStream tar) {