Martin Bonnin's talk at KotlinConf about building libraries▾
, I was inspired to migrate my libraries from JitPack to Maven Central, using the gradle-maven-publish-plugin he recommended.
Having never worked with signing before, I'm unsure whether my failing
signMavenPublication
task is due to the plugin itself, or the underlying
signing
plugin. The signing plugin gives instructions to provide your GPG keys using a system keychain (not feasible in CI), but the
gradle-maven-publish-plugin
provides instructions to use an in-memory key via ENV. I've set the following variables in my CI:
• ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD
• ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME
• ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY
• ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD
• ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID (optional)
Where the maven central credentials are from a generated user token (since I signed in to central with Github)
and my gradle file is configure like so: