Releases are deployed to the Sonatype Central Portal (https://central.sonatype.com)
via the JReleaser Gradle plugin (configured in build.gradle). The old OSSRH flow
(s01.oss.sonatype.org + manual "close/release") is no longer used — OSSRH has been
retired.
-
A Central Portal account with a generated user token (central.sonatype.com -> profile -> Generate User Token). The legacy OSSRH credentials (
s01.oss.sonatype.org) do NOT work against the Central Portal — a 401 during deploy almost always means an OSSRH/wrong token is being used. -
The
com.linbitnamespace must be verified for that account on the Central Portal (the published groupIdcom.linbit.linstor.apilives under it). -
A GPG key for signing — JReleaser signs every artifact (
signing.active = ALWAYS), and the matching public key must be published to a keyserver (e.g. keys.openpgp.org) so the Portal can verify the signatures. -
Credentials passed to JReleaser via environment variables. Run
./gradlew jreleaserEnvto print the exact names it expects:
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME # Central Portal token username JRELEASER_MAVENCENTRAL_SONATYPE_TOKEN # Central Portal token password JRELEASER_GPG_PUBLIC_KEY # armored public key JRELEASER_GPG_SECRET_KEY # armored secret key (signs the artifacts) JRELEASER_GPG_PASSPHRASE # passphrase for the secret keyThe
signingblock inbuild.gradlesets nomode, so JReleaser signs in-process (modeMEMORY) and needs the whole key pair — with only the secret key it fails with "JRELEASER_GPG_PUBLIC_KEY must be set". Export both from the keyring:export JRELEASER_GPG_PUBLIC_KEY="$(gpg --armor --export <key-id>)" export JRELEASER_GPG_SECRET_KEY="$(gpg --armor --export-secret-keys <key-id>)"These can also live in
~/.jreleaser/config.properties. Note that thesigning.*andsonatype*entries ingradle.propertiesbelong to the Gradle signing and the old OSSRH publishing plugins — JReleaser does not read them.Alternatively set
mode = 'COMMAND'in thesigningblock to sign with the local gpg binary instead of handing the keys to JReleaser.
-
Set the release
versioninbuild.gradle(no-SNAPSHOT); commit and tag. -
Build and stage the artifacts into the local staging repo:
./gradlew clean publishThis writes the jar,
-sources,-javadocand.pomunderbuild/staging-deploy. -
Sign and upload to the Central Portal:
./gradlew jreleaserDeployValidate the configuration first with
./gradlew jreleaserConfig. Use./gradlew jreleaserFullReleaseinstead if you also want JReleaser to create the matching Git release. -
Check the deployment at https://central.sonatype.com/ (Deployments) and publish it if your portal namespace is not set to auto-publish.
The staging directory must be the same on both sides. publish writes to
build/staging-deploy (layout.buildDirectory), so the JReleaser
stagingRepository(...) in build.gradle must point at build/staging-deploy too —
otherwise jreleaserDeploy uploads nothing.