From 4937547b8af047c62d1888a39bce19d406e137b1 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Fri, 5 Feb 2021 13:04:01 +0100 Subject: [PATCH] Fix build deprecation warnings about duplicate jar entries See gh-25116 --- spring-boot-project/spring-boot-cli/build.gradle | 5 ++++- .../spring-boot-loader-tools/build.gradle | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-cli/build.gradle b/spring-boot-project/spring-boot-cli/build.gradle index d0aa87b86f..a76bda576f 100644 --- a/spring-boot-project/spring-boot-cli/build.gradle +++ b/spring-boot-project/spring-boot-cli/build.gradle @@ -107,7 +107,10 @@ task fullJar(type: Jar) { into "BOOT-INF/classes" } into("") { - from zipTree(configurations.loader.singleFile) + from(zipTree(configurations.loader.singleFile)) { + exclude "META-INF/LICENSE.txt" + exclude "META-INF/NOTICE.txt" + } } manifest { attributes( diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle index b48676b56c..29fcf0bbc6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/build.gradle @@ -41,8 +41,9 @@ sourceSets { task reproducibleLoaderJar(type: Jar) { dependsOn configurations.loader - from { - zipTree(configurations.loader.incoming.files.filter {it.name.startsWith "spring-boot-loader" }.singleFile) + from(zipTree(configurations.loader.incoming.files.filter {it.name.startsWith "spring-boot-loader" }.singleFile)) { + exclude "META-INF/LICENSE.txt" + exclude "META-INF/NOTICE.txt" } reproducibleFileOrder = true preserveFileTimestamps = false @@ -52,8 +53,9 @@ task reproducibleLoaderJar(type: Jar) { task reproducibleJarModeLayerToolsJar(type: Jar) { dependsOn configurations.jarmode - from { - zipTree(configurations.jarmode.incoming.files.filter {it.name.startsWith "spring-boot-jarmode-layertools" }.singleFile) + from(zipTree(configurations.jarmode.incoming.files.filter {it.name.startsWith "spring-boot-jarmode-layertools" }.singleFile)) { + exclude "META-INF/LICENSE.txt" + exclude "META-INF/NOTICE.txt" } reproducibleFileOrder = true preserveFileTimestamps = false