From f5fabbc1b9b58d0232fa74adbf3e6e3c01d0c0fa Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 May 2018 11:34:42 +0100 Subject: [PATCH] Remove the use of internal API from Gradle Plugin's BootJar Closes gh-13037 --- .../boot/gradle/tasks/bundling/BootJar.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 dfbebbb2bf..743804919e 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 @@ -37,7 +37,7 @@ import org.gradle.api.tasks.bundling.Jar; */ public class BootJar extends Jar implements BootArchive { - private BootArchiveSupport support = new BootArchiveSupport( + private final BootArchiveSupport support = new BootArchiveSupport( "org.springframework.boot.loader.JarLauncher", this::resolveZipCompression); private FileCollection classpath; @@ -48,10 +48,8 @@ public class BootJar extends Jar implements BootArchive { * Creates a new {@code BootJar} task. */ public BootJar() { - CopySpec bootInf = getRootSpec().addChildBeforeSpec(getMainSpec()) - .into("BOOT-INF"); - bootInf.into("classes", classpathFiles(File::isDirectory)); - bootInf.into("lib", classpathFiles(File::isFile)); + into("BOOT-INF/classes", classpathFiles(File::isDirectory)); + into("BOOT-INF/lib", classpathFiles(File::isFile)); } private Action classpathFiles(Spec filter) {