Repository navigation
ci: publish through the Central Portal OSSRH staging API - #21
Conversation
Sonatype retired OSSRH (s01.oss.sonatype.org) on 2025-06-30 and now answers every request with HTTP 402, which failed the v1.7.0 publish at initializeSonatypeStagingRepository. Point the nexus publish plugin at the Central Portal's OSSRH-compatible staging API and snapshot repository, and bump the plugin to 2.0.0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. WalkthroughThe Gradle Nexus Publish plugin version changes from 1.3.0 to 2.0.0. The Sonatype publishing configuration changes its staging and snapshots repository URLs to the Central endpoints. The environment variables used for repository credentials remain unchanged. Estimated code review effort: 2 (Simple) | ~8 minutes Possibly related PRs
Suggested reviewers: Merge Risk:
|
joalves
left a comment
There was a problem hiding this comment.
Thanks, the endpoint change and the plugin bump look right. The Portal's OSSRH Staging API is the smallest move off s01.oss.sonatype.org.
There's one risk this PR doesn't cover. Once the credentials are fixed, the next failure is likely to be at signing, because signing hasn't run on today's runners: the v1.7.0 run failed at initializeSonatypeStagingRepository, before it got that far.
publish.ymlrunsln -s /usr/local/bin/gpg /usr/local/bin/gpg2. Onubuntu-latest,gpgis in/usr/bin, so that link probably points at nothing.useGpgCmd()callsgpg2unlesssigning.gnupg.executableis set, so signing would fail with "gpg2 not found". That's unless theGRADLE_PROPERTIESsecret setssigning.gnupg.executable=gpg. I can't read the secret, so I can't tell.
Possible fixes, any of which would do:
- Add
signing.gnupg.executable=gpgtoGRADLE_PROPERTIES, or pass-Psigning.gnupg.executable=gpgin the workflow, and drop theln -sline. - Switch to in-memory signing (
useInMemoryPgpKeys(key, password)fromGPG_KEYandGPG_PASSWORD), which doesn't need agpgbinary.
It would also help to add a workflow_dispatch input such as release (default false). With false, the workflow runs publish closeSonatypeStagingRepository without releasing, so the deployment waits in the Portal and can be dropped. That lets us check the new token and signing before re-releasing 1.7.0, instead of finding out on the tag.
Neither point blocks merging this PR. Signing can be a follow-up if the first real run fails there.
joalves
left a comment
There was a problem hiding this comment.
Approving: the Central Portal staging endpoint and the plugin upgrade are the right fix. The Portal token is now in the secrets. Signing is the open risk from my earlier comment, and the 1.7.0 publish run will tell us.
Why
The
v1.7.0publish failed atinitializeSonatypeStagingRepository(run):Sonatype shut down OSSRH (
s01.oss.sonatype.org) on 2025-06-30. It now returns HTTP 402 to every request, so every release since then would fail the same way.What
nexusPublishingat the Central Portal's OSSRH-compatible staging API (https://ossrh-staging-api.central.sonatype.com/service/local/) and its snapshot repository (https://central.sonatype.com/repository/maven-snapshots/).io.github.gradle-nexus.publish-pluginfrom 1.3.0 to 2.0.0.The workflow, secret names and GPG signing stay the same.
Required before publishing
The
MAVEN_CENTRAL_USERNAME/MAVEN_CENTRAL_PASSWORDsecrets were last updated on 2023-11-07, so they are almost certainly old OSSRH logins. The Central Portal does not accept those. Someone with Sonatype access forcom.absmartlyneeds to:com.absmartly.sdknamespace is listed.MAVEN_CENTRAL_USERNAME/MAVEN_CENTRAL_PASSWORDrepository secrets.After this is merged and the secrets are updated, re-run the
v1.7.0publish. Nothing reached Maven Central in the failed run.Verification
./gradlew clean build publish closeAndReleaseSonatypeStagingRepository -x test -x testJdk25 --dry-runloads plugin 2.0.0 and resolves every Sonatype task.spotlessCheckpasses.🤖 Generated with Claude Code
Summary by CodeRabbit