Revert "Fail fast when finalName is misconfigured"

This reverts commit 263b7c20e4.

See gh-25590
This commit is contained in:
Andy Wilkinson
2021-03-17 11:11:24 +00:00
parent 263b7c20e4
commit ae2ff7849b
7 changed files with 34 additions and 107 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -153,8 +153,7 @@ public class BuildImageMojo extends AbstractPackagerMojo {
}
private BuildRequest getBuildRequest(Libraries libraries) {
ImagePackager imagePackager = new ImagePackager(getJarFile());
Function<Owner, TarArchive> content = (owner) -> getApplicationContent(owner, libraries, imagePackager);
Function<Owner, TarArchive> content = (owner) -> getApplicationContent(owner, libraries);
Image image = (this.image != null) ? this.image : new Image();
if (image.name == null && this.imageName != null) {
image.setName(this.imageName);
@@ -168,8 +167,8 @@ public class BuildImageMojo extends AbstractPackagerMojo {
return customize(image.getBuildRequest(this.project.getArtifact(), content));
}
private TarArchive getApplicationContent(Owner owner, Libraries libraries, ImagePackager imagePackager) {
ImagePackager packager = getConfiguredPackager(() -> imagePackager);
private TarArchive getApplicationContent(Owner owner, Libraries libraries) {
ImagePackager packager = getConfiguredPackager(() -> new ImagePackager(getJarFile()));
return new PackagedTarArchive(owner, libraries, packager);
}