diff --git a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/build.gradle index bd774a035e..1f78242394 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/build.gradle @@ -15,3 +15,8 @@ dependencies { testImplementation("org.mockito:mockito-core") testImplementation("org.mockito:mockito-junit-jupiter") } + +jar { + reproducibleFileOrder = true + preserveFileTimestamps = false +} 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 4f862cfe93..c6b1873170 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 @@ -50,24 +50,18 @@ task reproducibleLoaderJar(type: Jar) { destinationDirectory = file("${generatedResources}/META-INF/loader") } -task reproducibleJarModeLayerToolsJar(type: Jar) { +task layerToolsJar(type: Sync) { dependsOn configurations.jarmode from { - zipTree(configurations.jarmode.incoming.files.singleFile).matching { - exclude "META-INF/LICENSE.txt" - exclude "META-INF/NOTICE.txt" - exclude "META-INF/spring-boot.properties" - } + file(configurations.jarmode.incoming.files.singleFile) } - reproducibleFileOrder = true - preserveFileTimestamps = false - archiveFileName = "spring-boot-jarmode-layertools.jar" - destinationDirectory = file("${generatedResources}/META-INF/jarmode") + rename({ "spring-boot-jarmode-layertools.jar" }) + into(file("${generatedResources}/META-INF/jarmode")) } sourceSets { main { - output.dir(generatedResources, builtBy: [reproducibleJarModeLayerToolsJar, reproducibleLoaderJar]) + output.dir(generatedResources, builtBy: [layerToolsJar, reproducibleLoaderJar]) } }