Ensure LayoutFactory is not passed an empty file
Update `Repackager` to ensure that `getLayout` is called before we backup the source file. This restores earlier behavior that some custom `ModuleFactory` implementations were relying on. Closes gh-22995
This commit is contained in:
@@ -101,6 +101,7 @@ public class Repackager extends Packager {
|
||||
public void repackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime)
|
||||
throws IOException {
|
||||
Assert.isTrue(destination != null && !destination.isDirectory(), "Invalid destination");
|
||||
getLayout(); // get layout early
|
||||
if (lastModifiedTime != null && getLayout() instanceof War) {
|
||||
throw new IllegalStateException("Reproducible repackaging is not supported with war packaging");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user