Skip to content

Commit

Permalink
Failed to publish publication 'graceXxxPluginMarkerMaven' to reposito…
Browse files Browse the repository at this point in the history
…ry 'Sonatype'

Closes gh-841
  • Loading branch information
rainboyan committed Dec 25, 2024
1 parent 837e6a9 commit c88f186
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ subprojects { project ->
ext.isTestSuite = project.name.startsWith("grace-test-suite")
ext.isCiBuild = project.hasProperty("isCiBuild") || System.getenv().get("CI") as Boolean
ext.pomInfo = {
if (project.name == 'grace-gradle-plugin') {
delegate.name "Grace Gradle Plugin"
delegate.description "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins"
}
else {
if (project.name != 'grace-gradle-plugin') {
def projectName = project.name.split('-')*.capitalize().join(' ')
delegate.name projectName
delegate.description "Grace Framework : $projectName"
Expand Down
35 changes: 35 additions & 0 deletions grace-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,38 @@ tasks.withType(Copy) {
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}

if (isReleaseVersion) {
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
Publication[] publications = new Publication[publishing.publications.size()]
publishing.publications.findAll().toArray(publications)
sign(publications)
}
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
}

project.afterEvaluate {
project.publishing.publications.each { publication->
if (publication instanceof MavenPublication) {
publication.pom {
if (publication.name == "maven" || publication.name == "pluginMaven") {
name = "Grace Gradle Plugin"
description = "Grace Framework : A Gradle plugin for Grace which provides a bunch of useful plugins"
}

if (publication.name == "pluginMaven" || publication.name.endsWith("PluginMarkerMaven")) {
withXml {
def xml = asNode()
xml.children().last() + pomInfo
}
}
}
}
}
}

0 comments on commit c88f186

Please sign in to comment.