Remove APIs deprecated for removal in 3.5

Closes gh-43788
This commit is contained in:
Andy Wilkinson
2025-01-14 12:34:43 +00:00
parent f301b2a123
commit 2f29a49a1d
61 changed files with 29 additions and 3522 deletions

View File

@@ -17,11 +17,8 @@
package org.springframework.boot.buildpack.platform.docker;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -293,34 +290,6 @@ public class DockerApi {
}
}
/**
* Export the layers of an image as paths to layer tar files.
* @param reference the reference to export
* @param exports a consumer to receive the layer tar file paths (file can only be
* accessed during the callback)
* @throws IOException on IO error
* @since 2.7.10
* @deprecated since 3.2.6 for removal in 3.5.0 in favor of
* {@link #exportLayers(ImageReference, IOBiConsumer)}
*/
@Deprecated(since = "3.2.6", forRemoval = true)
public void exportLayerFiles(ImageReference reference, IOBiConsumer<String, Path> exports) throws IOException {
Assert.notNull(reference, "'reference' must not be null");
Assert.notNull(exports, "'exports' must not be null");
exportLayers(reference, (name, archive) -> {
Path path = Files.createTempFile("docker-export-layer-files-", null);
try {
try (OutputStream out = Files.newOutputStream(path)) {
archive.writeTo(out);
exports.accept(name, path);
}
}
finally {
Files.delete(path);
}
});
}
/**
* Export the layers of an image as {@link TarArchive TarArchives}.
* @param reference the reference to export

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -78,28 +78,6 @@ public abstract class ProgressUpdateEvent extends UpdateEvent {
this.total = total;
}
/**
* Return the current progress value.
* @return the current progress
* @deprecated since 3.3.7 for removal in 3.5.0 in favor of
* {@link #asPercentage()}
*/
@Deprecated(since = "3.3.7", forRemoval = true)
public int getCurrent() {
return (int) Long.min(this.current, Integer.MAX_VALUE);
}
/**
* Return the total progress possible value.
* @return the total progress possible
* @deprecated since 3.3.7 for removal in 3.5.0 in favor of
* {@link #asPercentage()}
*/
@Deprecated(since = "3.3.7", forRemoval = true)
public int getTotal() {
return (int) Long.min(this.total, Integer.MAX_VALUE);
}
/**
* Return the progress as a percentage.
* @return the progress percentage
@@ -110,14 +88,7 @@ public abstract class ProgressUpdateEvent extends UpdateEvent {
return (percentage < 0) ? 0 : Math.min(percentage, 100);
}
/**
* Return if the progress detail is considered empty.
* @param progressDetail the progress detail to check
* @return if the progress detail is empty
* @deprecated since 3.3.7 for removal in 3.5.0
*/
@Deprecated(since = "3.3.7", forRemoval = true)
public static boolean isEmpty(ProgressDetail progressDetail) {
private static boolean isEmpty(ProgressDetail progressDetail) {
return progressDetail == null || progressDetail.current == null || progressDetail.total == null;
}

View File

@@ -23,10 +23,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
@@ -392,21 +389,6 @@ class DockerApiTests {
assertThat(image.getLayers()).hasSize(46);
}
@Test
@SuppressWarnings("removal")
void exportLayersWhenReferenceIsNullThrowsException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.api.exportLayerFiles(null, (name, archive) -> {
})).withMessage("'reference' must not be null");
}
@Test
@SuppressWarnings("removal")
void exportLayersWhenExportsIsNullThrowsException() {
ImageReference reference = ImageReference.of("gcr.io/paketo-buildpacks/builder:base");
assertThatIllegalArgumentException().isThrownBy(() -> this.api.exportLayerFiles(reference, null))
.withMessage("'exports' must not be null");
}
@Test
void exportLayersExportsLayerTars() throws Exception {
ImageReference reference = ImageReference.of("gcr.io/paketo-buildpacks/builder:base");
@@ -463,29 +445,6 @@ class DockerApiTests {
.containsExactly("/cnb/stack.toml");
}
@Test
@SuppressWarnings("removal")
void exportLayerFilesDeletesTempFiles() throws Exception {
ImageReference reference = ImageReference.of("gcr.io/paketo-buildpacks/builder:base");
URI exportUri = new URI(IMAGES_URL + "/gcr.io/paketo-buildpacks/builder:base/get");
given(DockerApiTests.this.http.get(exportUri)).willReturn(responseOf("export.tar"));
List<Path> layerFilePaths = new ArrayList<>();
this.api.exportLayerFiles(reference, (name, path) -> layerFilePaths.add(path));
layerFilePaths.forEach((path) -> assertThat(path.toFile()).doesNotExist());
}
@Test
@SuppressWarnings("removal")
void exportLayersWithNoManifestThrowsException() throws Exception {
ImageReference reference = ImageReference.of("gcr.io/paketo-buildpacks/builder:base");
URI exportUri = new URI(IMAGES_URL + "/gcr.io/paketo-buildpacks/builder:base/get");
given(DockerApiTests.this.http.get(exportUri)).willReturn(responseOf("export-no-manifest.tar"));
String expectedMessage = "Exported image '%s' does not contain 'index.json' or 'manifest.json'"
.formatted(reference);
assertThatIllegalStateException().isThrownBy(() -> this.api.exportLayerFiles(reference, (name, archive) -> {
})).withMessageContaining(expectedMessage);
}
@Test
void tagWhenReferenceIsNullThrowsException() {
ImageReference tag = ImageReference.of("localhost:5000/ubuntu");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -39,20 +39,14 @@ abstract class ProgressUpdateEventTests<E extends ProgressUpdateEvent> {
}
@Test
@SuppressWarnings("removal")
void getProgressDetailsReturnsProgressDetails() {
ProgressUpdateEvent event = createEvent();
assertThat(event.getProgressDetail().getCurrent()).isOne();
assertThat(event.getProgressDetail().getTotal()).isEqualTo(2);
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
}
@Test
@SuppressWarnings("removal")
void getProgressDetailsReturnsProgressDetailsForLongNumbers() {
ProgressUpdateEvent event = createEvent("status", new ProgressDetail(4000000000L, 8000000000L), "progress");
assertThat(event.getProgressDetail().getCurrent()).isEqualTo(Integer.MAX_VALUE);
assertThat(event.getProgressDetail().getTotal()).isEqualTo(Integer.MAX_VALUE);
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
}
@@ -62,27 +56,6 @@ abstract class ProgressUpdateEventTests<E extends ProgressUpdateEvent> {
assertThat(event.getProgress()).isEqualTo("progress");
}
@Test
@SuppressWarnings("removal")
void progressDetailIsEmptyWhenCurrentIsNullReturnsTrue() {
ProgressDetail detail = new ProgressDetail(null, 2L);
assertThat(ProgressDetail.isEmpty(detail)).isTrue();
}
@Test
@SuppressWarnings("removal")
void progressDetailIsEmptyWhenTotalIsNullReturnsTrue() {
ProgressDetail detail = new ProgressDetail(1L, null);
assertThat(ProgressDetail.isEmpty(detail)).isTrue();
}
@Test
@SuppressWarnings("removal")
void progressDetailIsEmptyWhenTotalAndCurrentAreNotNullReturnsFalse() {
ProgressDetail detail = new ProgressDetail(1L, 2L);
assertThat(ProgressDetail.isEmpty(detail)).isFalse();
}
protected E createEvent() {
return createEvent("status", new ProgressDetail(1L, 2L), "progress");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -36,8 +36,6 @@ class PullUpdateEventTests extends AbstractJsonTests {
PullImageUpdateEvent.class);
assertThat(event.getId()).isEqualTo("4f4fb700ef54");
assertThat(event.getStatus()).isEqualTo("Extracting");
assertThat(event.getProgressDetail().getCurrent()).isEqualTo(16);
assertThat(event.getProgressDetail().getTotal()).isEqualTo(32);
assertThat(event.getProgressDetail().asPercentage()).isEqualTo(50);
assertThat(event.getProgress()).isEqualTo("[==================================================>] 32B/32B");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -154,10 +154,8 @@ public abstract class BootJar extends Jar implements BootArchive {
jarmodeToolsLocation);
}
@SuppressWarnings("removal")
private boolean isIncludeJarmodeTools() {
return Boolean.TRUE.equals(this.getIncludeTools().get())
&& Boolean.TRUE.equals(this.layered.getIncludeLayerTools().get());
return Boolean.TRUE.equals(this.getIncludeTools().get());
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -128,10 +128,8 @@ public abstract class BootWar extends War implements BootArchive {
layerResolver, jarmodeToolsLocation);
}
@SuppressWarnings("removal")
private boolean isIncludeJarmodeTools() {
return Boolean.TRUE.equals(this.getIncludeTools().get())
&& Boolean.TRUE.equals(this.layered.getIncludeLayerTools().get());
return Boolean.TRUE.equals(this.getIncludeTools().get());
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -64,20 +64,8 @@ public abstract class LayeredSpec {
this.application = objects.newInstance(ApplicationSpec.class);
this.dependencies = objects.newInstance(DependenciesSpec.class);
getEnabled().convention(true);
getIncludeLayerTools().convention(true);
}
/**
* Returns whether the layer tools should be included as a dependency in the layered
* archive.
* @return whether the layer tools should be included
* @since 3.0.0
* @deprecated since 3.3.0 for removal in 3.5.0 in favor of {@code includeTools}.
*/
@Input
@Deprecated(since = "3.3.0", forRemoval = true)
public abstract Property<Boolean> getIncludeLayerTools();
/**
* Returns whether the layers.idx should be included in the archive.
* @return whether the layers.idx should be included

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -321,18 +321,6 @@ abstract class AbstractBootArchiveIntegrationTests {
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}
@TestTemplate
void notUpToDateWhenBuiltWithLayerToolsAndThenWithoutLayerTools() {
assertThat(this.gradleBuild.scriptProperty("layerTools", "")
.build(this.taskName)
.task(":" + this.taskName)
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.scriptProperty("layerTools", "includeLayerTools = false")
.build(this.taskName)
.task(":" + this.taskName)
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}
@TestTemplate
void notUpToDateWhenBuiltWithToolsAndThenWithoutTools() {
assertThat(this.gradleBuild.scriptProperty("includeTools", "")

View File

@@ -626,14 +626,6 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
assertThat(entryNames).isNotEmpty().contains(this.libPath + JarModeLibrary.TOOLS.getName());
}
@Test
@SuppressWarnings("removal")
void whenArchiveIsLayeredAndIncludeLayerToolsIsFalseThenLayerToolsAreNotAddedToTheJar() throws IOException {
List<String> entryNames = getEntryNames(
createLayeredJar((configuration) -> configuration.getIncludeLayerTools().set(false)));
assertThat(entryNames).isNotEmpty().doesNotContain(this.libPath + JarModeLibrary.TOOLS.getName());
}
@Test
void whenIncludeToolsIsFalseThenToolsAreNotAddedToTheJar() throws IOException {
this.task.getIncludeTools().set(false);

View File

@@ -1,11 +0,0 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
}
bootJar {
mainClass = 'com.example.Application'
layered {
{layerTools}
}
}

View File

@@ -1,12 +0,0 @@
plugins {
id 'java'
id 'org.springframework.boot' version '{version}'
id 'war'
}
bootWar {
mainClass = 'com.example.Application'
layered {
{layerTools}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -408,19 +408,6 @@ class JarIntegrationTests extends AbstractArchiveIntegrationTests {
});
}
@TestTemplate
void whenJarIsRepackagedWithTheLayersEnabledAndLayerToolsExcluded(MavenBuild mavenBuild) {
mavenBuild.project("jar-layered-no-layer-tools").execute((project) -> {
File repackaged = new File(project, "jar/target/jar-layered-0.0.1.BUILD-SNAPSHOT.jar");
assertThat(jar(repackaged)).hasEntryWithNameStartingWith("BOOT-INF/classes/")
.hasEntryWithNameStartingWith("BOOT-INF/lib/jar-release")
.hasEntryWithNameStartingWith("BOOT-INF/lib/jar-snapshot")
.hasEntryWithNameStartingWith("BOOT-INF/layers.idx")
.doesNotHaveEntryWithNameStartingWith(
"BOOT-INF/lib/" + JarModeLibrary.TOOLS.getCoordinates().getArtifactId());
});
}
@TestTemplate
void whenJarIsRepackagedWithToolsExclude(MavenBuild mavenBuild) {
mavenBuild.project("jar-no-tools").execute((project) -> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -184,19 +184,6 @@ class WarIntegrationTests extends AbstractArchiveIntegrationTests {
});
}
@TestTemplate
void whenWarIsRepackagedWithTheLayersEnabledAndLayerToolsExcluded(MavenBuild mavenBuild) {
mavenBuild.project("war-layered-no-layer-tools").execute((project) -> {
File repackaged = new File(project, "war/target/war-layered-0.0.1.BUILD-SNAPSHOT.war");
assertThat(jar(repackaged)).hasEntryWithNameStartingWith("WEB-INF/classes/")
.hasEntryWithNameStartingWith("WEB-INF/lib/jar-release")
.hasEntryWithNameStartingWith("WEB-INF/lib/jar-snapshot")
.hasEntryWithNameStartingWith("WEB-INF/layers.idx")
.doesNotHaveEntryWithNameStartingWith(
"WEB-INF/lib/" + JarModeLibrary.TOOLS.getCoordinates().getArtifactId());
});
}
@TestTemplate
void whenWarIsRepackagedWithToolsExclude(MavenBuild mavenBuild) {
mavenBuild.project("war-no-tools").execute((project) -> {

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-release</artifactId>
<version>0.0.1.RELEASE</version>
<packaging>jar</packaging>
<name>jar</name>
<description>Release Jar dependency</description>
</project>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-snapshot</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jar</name>
<description>Snapshot Jar dependency</description>
</project>

View File

@@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-layered</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>@java.version@</maven.compiler.source>
<maven.compiler.target>@java.version@</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<layers>
<includeLayerTools>false</includeLayerTools>
</layers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-snapshot</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-release</artifactId>
<version>0.0.1.RELEASE</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,24 +0,0 @@
/*
* 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.test;
public class SampleApplication {
public static void main(String[] args) {
}
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>aggregator</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>@java.version@</maven.compiler.source>
<maven.compiler.target>@java.version@</maven.compiler.target>
</properties>
<modules>
<module>jar-snapshot</module>
<module>jar-release</module>
<module>jar</module>
</modules>
</project>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-release</artifactId>
<version>0.0.1.RELEASE</version>
<packaging>jar</packaging>
<name>jar</name>
<description>Release Jar dependency</description>
</project>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-snapshot</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
<packaging>jar</packaging>
<name>jar</name>
<description>Snapshot Jar dependency</description>
</project>

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>aggregator</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>@java.version@</maven.compiler.source>
<maven.compiler.target>@java.version@</maven.compiler.target>
</properties>
<modules>
<module>jar-snapshot</module>
<module>jar-release</module>
<module>war</module>
</modules>
</project>

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>aggregator</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
</parent>
<artifactId>war-layered</artifactId>
<packaging>war</packaging>
<name>war</name>
<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<layers>
<includeLayerTools>false</includeLayerTools>
</layers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>@maven-war-plugin.version@</version>
<configuration>
<archive>
<manifestEntries>
<Not-Used>Foo</Not-Used>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>@spring-framework.version@</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>@jakarta-servlet.version@</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-snapshot</artifactId>
<version>0.0.1.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot.maven.it</groupId>
<artifactId>jar-release</artifactId>
<version>0.0.1.RELEASE</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,24 +0,0 @@
/*
* Copyright 2012-2021 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.test;
public class SampleApplication {
public static void main(String[] args) {
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -180,12 +180,8 @@ public abstract class AbstractPackagerMojo extends AbstractDependencyFilterMojo
return packager;
}
@SuppressWarnings("removal")
private boolean getIncludeRelevantJarModeJars() {
if (!this.includeTools) {
return false;
}
return this.layers.isIncludeLayerTools();
return this.includeTools;
}
private CustomLayers getCustomLayers(File configuration) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2024 the original author or authors.
* Copyright 2012-2025 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.
@@ -28,9 +28,6 @@ public class Layers {
private boolean enabled = true;
@Deprecated(since = "3.3.0", forRemoval = true)
private boolean includeLayerTools = true;
private File configuration;
/**
@@ -41,16 +38,6 @@ public class Layers {
return this.enabled;
}
/**
* Whether to include the layer tools jar.
* @return true if layer tools should be included
* @deprecated since 3.3.0 for removal in 3.5.0 in favor of {@code includeTools}.
*/
@Deprecated(since = "3.3.0", forRemoval = true)
public boolean isIncludeLayerTools() {
return this.includeLayerTools;
}
/**
* The location of the layers configuration file. If no file is provided, a default
* configuration is used with four layers: {@code application}, {@code resources},