Support Maven's reproducible build feature for war repackaging

See gh-25571
This commit is contained in:
Jurrie Overgoor
2021-03-10 13:27:47 +01:00
committed by Andy Wilkinson
parent 9180220cf4
commit 3c0e236562
3 changed files with 28 additions and 13 deletions

View File

@@ -21,7 +21,6 @@ import java.io.IOException;
import java.nio.file.attribute.FileTime;
import java.util.jar.JarFile;
import org.springframework.boot.loader.tools.Layouts.War;
import org.springframework.util.Assert;
/**
@@ -102,9 +101,6 @@ public class Repackager extends Packager {
throws IOException {
Assert.isTrue(destination != null && !destination.isDirectory(), "Invalid destination");
Layout layout = getLayout(); // get layout early
if (lastModifiedTime != null && layout instanceof War) {
throw new IllegalStateException("Reproducible repackaging is not supported with war packaging");
}
destination = destination.getAbsoluteFile();
File source = getSource();
if (isAlreadyPackaged() && source.equals(destination)) {