diff --git a/gradle-plugin/build.gradle b/gradle-plugin/build.gradle index 9f90ba6c3..9f34d709f 100644 --- a/gradle-plugin/build.gradle +++ b/gradle-plugin/build.gradle @@ -53,10 +53,11 @@ gradlePlugin { afterEvaluate { signing { + def publicationContainer = project.extensions.findByType(PublishingExtension).publications required = { isReleaseVersion && gradle.taskGraph.hasTask('publish') } - Publication[] publications = new Publication[publishing.publications.size() - 1] - publishing.publications.findAll { it.name != 'pluginMaven' }.toArray(publications) - sign(publications) + Publication[] publicationsToSign = new Publication[publicationContainer.size() - 1] + publicationContainer.findAll { it.name != 'pluginMaven' }.toArray(publicationsToSign) + sign(publicationsToSign) } publishing.publications.each { publication -> diff --git a/gradle/grailsCentralPublishing.gradle b/gradle/grailsCentralPublishing.gradle index c7ac1470f..c71bd202e 100644 --- a/gradle/grailsCentralPublishing.gradle +++ b/gradle/grailsCentralPublishing.gradle @@ -40,10 +40,12 @@ project.extensions.configure(PublishingExtension) { PublishingExtension pe -> } afterEvaluate { - def mavenPublication = project.extensions.findByType(PublishingExtension).publications.named('pluginMaven') - project.extensions.configure(SigningExtension) { SigningExtension se -> + def publicationContainer = extensions.findByType(PublishingExtension).publications + extensions.configure(SigningExtension) { SigningExtension se -> se.required = { isReleaseVersion && gradle.taskGraph.hasTask('publish') } - se.sign mavenPublication.get() + Publication[] publicationsToSign = new Publication[publicationContainer.size()] + publicationContainer.findAll().toArray(publicationsToSign) + se.sign(publicationsToSign) } }