Revert "Merge branch '2.3.x' into 2.4.x"

This reverts commit eaa510872a, reversing
changes made to 3e69522e2d.

See gh-25700
This commit is contained in:
Andy Wilkinson
2021-03-17 11:13:58 +00:00
parent 6ddf525ac0
commit ed4e419b0c
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.
@@ -186,8 +186,7 @@ public class BuildImageMojo extends AbstractPackagerMojo {
}
private BuildRequest getBuildRequest(Libraries libraries) throws MojoExecutionException {
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);
@@ -218,8 +217,8 @@ public class BuildImageMojo extends AbstractPackagerMojo {
|| this.docker.getPublishRegistry().isEmpty();
}
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);
}