This is an automated email from the ASF dual-hosted git repository. jdaugherty pushed a commit to branch providerSupport-pomCustomization in repository https://gitbox.apache.org/repos/asf/grails-gradle-publish.git
commit 5b4544d9b8a9f2aa3568fd9ee3ceda6c1d88c612 Author: James Daugherty <[email protected]> AuthorDate: Tue Nov 25 14:11:23 2025 -0500 feature: switch pomCustomization to a property so that provider can be used for deferred initialization --- .../apache/grails/gradle/publish/GrailsPublishExtension.groovy | 2 +- .../grails/gradle/publish/GrailsPublishGradlePlugin.groovy | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishExtension.groovy b/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishExtension.groovy index a1d4c54..6080ff4 100644 --- a/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishExtension.groovy +++ b/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishExtension.groovy @@ -111,7 +111,7 @@ class GrailsPublishExtension { /** * An optional closure to be invoked via pom.withXml { } to allow further customization */ - Closure pomCustomization + final Property<Closure> pomCustomization /** * If another process will add the components set this to false so only the publication is created diff --git a/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishGradlePlugin.groovy b/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishGradlePlugin.groovy index 2031180..cff7b77 100644 --- a/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishGradlePlugin.groovy +++ b/plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishGradlePlugin.groovy @@ -404,10 +404,11 @@ Note: if project properties are used, the properties must be defined prior to ap } } - if (gpe.pomCustomization) { - gpe.pomCustomization.delegate = pom - gpe.pomCustomization.resolveStrategy = Closure.DELEGATE_FIRST - gpe.pomCustomization.call(xml) + if (gpe.pomCustomization && gpe.pomCustomization.isPresent()) { + Closure pomCustomization = gpe.pomCustomization.get() + pomCustomization.delegate = pom + pomCustomization.resolveStrategy = Closure.DELEGATE_FIRST + pomCustomization.call(xml) } // fix dependencies without a version, this can occur when the spring dependency management plugin is used
