Skip to content

Commit c88f186

Browse files
committed
Failed to publish publication 'graceXxxPluginMarkerMaven' to repository 'Sonatype'
Closes gh-841
1 parent 837e6a9 commit c88f186

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,7 @@ subprojects { project ->
138138
ext.isTestSuite = project.name.startsWith("grace-test-suite")
139139
ext.isCiBuild = project.hasProperty("isCiBuild") || System.getenv().get("CI") as Boolean
140140
ext.pomInfo = {
141-
if (project.name == 'grace-gradle-plugin') {
142-
delegate.name "Grace Gradle Plugin"
143-
delegate.description "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins"
144-
}
145-
else {
141+
if (project.name != 'grace-gradle-plugin') {
146142
def projectName = project.name.split('-')*.capitalize().join(' ')
147143
delegate.name projectName
148144
delegate.description "Grace Framework : $projectName"

grace-gradle-plugin/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,38 @@ tasks.withType(Copy) {
130130
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
131131
shouldRunAfter(tasks.withType(Sign))
132132
}
133+
134+
if (isReleaseVersion) {
135+
afterEvaluate {
136+
signing {
137+
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
138+
Publication[] publications = new Publication[publishing.publications.size()]
139+
publishing.publications.findAll().toArray(publications)
140+
sign(publications)
141+
}
142+
}
143+
144+
tasks.withType(Sign) {
145+
onlyIf { isReleaseVersion }
146+
}
147+
}
148+
149+
project.afterEvaluate {
150+
project.publishing.publications.each { publication->
151+
if (publication instanceof MavenPublication) {
152+
publication.pom {
153+
if (publication.name == "maven" || publication.name == "pluginMaven") {
154+
name = "Grace Gradle Plugin"
155+
description = "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins"
156+
}
157+
158+
if (publication.name == "pluginMaven" || publication.name.endsWith("PluginMarkerMaven")) {
159+
withXml {
160+
def xml = asNode()
161+
xml.children().last() + pomInfo
162+
}
163+
}
164+
}
165+
}
166+
}
167+
}

0 commit comments

Comments
 (0)