From 564dd488a43a85b252f3d23cf4c099d9287c976b Mon Sep 17 00:00:00 2001 From: Puneet Behl Date: Fri, 3 Nov 2023 06:07:05 +0530 Subject: [PATCH] Update GroovyPagePlugin.groovy Configure duplicatesStrategy for bootWar and bootJar --- .../grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy b/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy index 88128b9f..2e10e546 100644 --- a/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPagePlugin.groovy @@ -6,6 +6,7 @@ import org.apache.tools.ant.taskdefs.condition.Os import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.file.FileCollection import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.SourceSetOutput @@ -86,6 +87,7 @@ class GroovyPagePlugin implements Plugin { allTasks.withType(War).configureEach { War war -> war.dependsOn compileGroovyPages + war.duplicatesStrategy = DuplicatesStrategy.EXCLUDE if (war.name == 'bootWar') { war.from(destDir) { into("WEB-INF/classes") @@ -101,14 +103,14 @@ class GroovyPagePlugin implements Plugin { } } allTasks.withType(Jar).configureEach { Jar jar -> + jar.dependsOn compileGroovyPages + jar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE if(!(jar instanceof War)) { if (jar.name == 'bootJar') { - jar.dependsOn compileGroovyPages jar.from(destDir) { into("BOOT-INF/classes") } } else if (jar.name == 'jar') { - jar.dependsOn compileGroovyPages jar.from destDir } }