Be more lenient when repackage is invoked several times

This commit makes the repackager more lenient when it is invoked several
times in the same lifecycle.

Closes gh-15034
This commit is contained in:
Stephane Nicoll
2018-11-27 15:09:55 +01:00
parent d7fe3c73a3
commit bf88a7e466
2 changed files with 7 additions and 5 deletions

View File

@@ -179,11 +179,11 @@ public class Repackager {
if (this.layout == null) {
this.layout = getLayoutFactory().getLayout(this.source);
}
if (alreadyRepackaged()) {
return;
}
destination = destination.getAbsoluteFile();
File workingSource = this.source;
if (alreadyRepackaged() && this.source.equals(destination)) {
return;
}
if (this.source.equals(destination)) {
workingSource = getBackupFile();
workingSource.delete();