From c98417bfde594021eaa505eeeb385a67b8259d04 Mon Sep 17 00:00:00 2001 From: James Fredley Date: Wed, 18 Sep 2024 19:09:29 -0400 Subject: [PATCH] Set duplicates strategy for all archive tasks --- .../gradle/plugin/core/GrailsGradlePlugin.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy index 7f1b5ce6..a324d8ac 100644 --- a/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy @@ -44,6 +44,7 @@ import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.SourceSetOutput import org.gradle.api.tasks.TaskContainer +import org.gradle.api.tasks.bundling.AbstractArchiveTask import org.gradle.api.tasks.bundling.Jar import org.gradle.api.tasks.compile.GroovyCompile import org.gradle.api.tasks.testing.Test @@ -143,6 +144,8 @@ class GrailsGradlePlugin extends GroovyPlugin { configureRunCommand(project) configurePathingJar(project) + + configureArchiveCommands(project) } protected void excludeDependencies(Project project) { @@ -702,4 +705,11 @@ class GrailsGradlePlugin extends GroovyPlugin { } fileCollection } + + protected void configureArchiveCommands(Project project) { + project.tasks.withType(AbstractArchiveTask).configureEach { + // the zip format supports duplicates and gradle implements this feature, so exclude them + it.duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } + } }