Peter Becker
03/30/2025, 3:04 AMExecution failed for task ':signMavenJavaPublication'.
> Cannot perform signing task ':signMavenJavaPublication' because it has no configured signatory
I've spent quite some time trying to resolve this, but even with debug output on I can't see why this would err, and the source code of the signing extension seems to indicate something was not injected, which makes it somewhat hard to follow.
The layout of my build.gradle.kts
looks like this:
plugins {
kotlin("jvm") version "2.1.20"
`java-library`
`maven-publish`
signing
}
...
kotlin {
jvmToolchain(21)
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
pom {
...
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
And my ~/.gradle/gradle.properties
has:
signing.keyId=233EB591
signing.password=...
signing.secreteKeyRingFile=/home/peter/.gnupg/secring.gpg
ossrhUsername=...
ossrhPassword=...
I also tried copying that file into the project's root folder, but that didn't help either.
What am I missing? Are there any tricks to debug this?
PS: One thing I am very unsure about is the keyId
bit, since gpg -K
doesn't show a keyId
field (the number is the last bit of the second line of sec
).Thomas Broyer
03/30/2025, 7:11 PMsigning.gnupg.keyName
with the same value as signing.keyId
in my gradle.properties
(and no signing.password
).
Been using that for years without any issue (and can't remember why I used that approach; I presume specifically to not have the key password in a file or on the command line)
HTH
edit: just checked the docs, and yes, that was the reason; of course that means I can only publish from my machine, and not from some CI.Peter Becker
03/30/2025, 10:13 PMVampire
03/30/2025, 10:23 PMVampire
03/30/2025, 10:24 PMVampire
03/30/2025, 10:25 PMPeter Becker
04/01/2025, 11:53 PMkeyId
is wrong. It's probably not a topic for this forum, but I think that error message could be better, and there should be debug logging to dump out all the properties involved (or at least the non-secret ones). Either of those would have probably avoided me being stupid for that long 🙂
Should I file an enhancement request for this somewhere? Happy to do that if I get a pointer.Vampire
04/02/2025, 2:36 AM