From 11b5e86ffd5f80e7734493fcb9e106d7c45ba1ca Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Sat, 17 Oct 2020 07:53:53 +0100 Subject: [PATCH] Deprecate BootJar#getConfigurations Fixes gh-23527 --- .../boot/gradle/tasks/bundling/BootJar.java | 8 ++++++++ .../boot/gradle/tasks/bundling/BootJarTests.java | 1 + 2 files changed, 9 insertions(+) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java index c53e42f400..d8090f8325 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootJar.java @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.concurrent.Callable; import org.gradle.api.Action; +import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; import org.gradle.api.file.CopySpec; import org.gradle.api.file.FileCollection; @@ -117,7 +118,14 @@ public class BootJar extends Jar implements BootArchive { return this.support.createCopyAction(this); } + /** + * Returns the {@link Configuration Configurations} of the project associated with + * this task. + * @return the configurations + * @deprecated since 2.3.5 in favor of {@link Project#getConfigurations} + */ @Internal + @Deprecated protected Iterable getConfigurations() { return getProject().getConfigurations(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java index 8ff1107d08..f5abae7d9e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarTests.java @@ -347,6 +347,7 @@ class BootJarTests extends AbstractBootArchiveTests { private Iterable configurations = Collections.emptySet(); @Override + @SuppressWarnings("deprecation") protected Iterable getConfigurations() { return this.configurations; }