Skip to content

Commit 4cbb66c

Browse files
committed
fix: correct plugin marker groupId for Sonatype publishing
1 parent b3c379c commit 4cbb66c

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

build.gradle.kts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
`kotlin-dsl`
3+
`java-gradle-plugin`
34
`maven-publish`
45
signing
56
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
@@ -93,29 +94,21 @@ publishing {
9394
}
9495
}
9596

96-
// Fix the groupId for plugin marker publications after they're created
97-
afterEvaluate {
98-
publishing {
99-
publications {
100-
withType<MavenPublication> {
101-
if (name.endsWith("PluginMarkerMaven")) {
102-
groupId = "io.github.lsd-consulting"
103-
}
104-
}
105-
}
106-
}
107-
}
10897

10998
signing {
110-
if (project.findProperty("signingKey") != null) {
99+
val signingKey: String? = findProperty("signingKey") as String?
100+
val signingPassword: String? = findProperty("signingPassword") as String?
101+
val signingKeyId: String? = findProperty("signing.keyId") as String?
102+
103+
if (signingKey != null && signingPassword != null) {
111104
// Use in-memory ascii-armored keys
112-
val signingKey: String? = findProperty("signingKey") as String?
113-
val signingPassword: String? = findProperty("signingPassword") as String?
114105
useInMemoryPgpKeys(signingKey, signingPassword)
115106
sign(publishing.publications)
116-
} else {
107+
} else if (signingKeyId != null && findProperty("signing.password") != null) {
117108
// Use signing properties in ~/.gradle/gradle.properties
118109
sign(publishing.publications)
110+
} else {
111+
logger.lifecycle("Signing disabled - no valid signing configuration found")
119112
}
120113
}
121114

0 commit comments

Comments
 (0)