Skip to content

ci: publish through the Central Portal OSSRH staging API - #21

Merged
joalves merged 1 commit into
mainfrom
fix/central-portal-publishing
Nov 11, 2026
Merged

joalves merged 1 commit into
mainfrom
fix/central-portal-publishing

Conversation

@Pedro-Revez-Silva

@Pedro-Revez-Silva Pedro-Revez-Silva commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

The v1.7.0 publish failed at initializeSonatypeStagingRepository (run):

Failed to load staging profiles, server at https://s01.oss.sonatype.org/service/local/ responded with status code 402

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

  • Point nexusPublishing at 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/).
  • Bump io.github.gradle-nexus.publish-plugin from 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_PASSWORD secrets 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 for com.absmartly needs to:

  1. Sign in at https://central.sonatype.com and confirm the com.absmartly.sdk namespace is listed.
  2. Generate a user token (Account → Generate User Token).
  3. Put the token's username and password into the existing MAVEN_CENTRAL_USERNAME / MAVEN_CENTRAL_PASSWORD repository secrets.

After this is merged and the secrets are updated, re-run the v1.7.0 publish. Nothing reached Maven Central in the failed run.

Verification

  • With no credentials, the old endpoint returns 402 and the new one returns 401, so the new one is running and expects a login.
  • Under JDK 17, ./gradlew clean build publish closeAndReleaseSonatypeStagingRepository -x test -x testJdk25 --dry-run loads plugin 2.0.0 and resolves every Sonatype task. spotlessCheck passes.
  • Not verified: a real publish, because that needs the new Portal token.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the release publishing configuration to use the current Central services. Existing environment-based credential settings remain unchanged. This keeps the project’s publishing setup aligned with the updated publishing infrastructure; no changes to application features or behavior are included.

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]>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The 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

  • absmartly/java-sdk#11: Updates the Nexus Publish plugin from 1.1.0 to 1.3.0 and retains the publishing setup that this change updates.

Suggested reviewers: joalves

Merge Risk: Minimal · up to c9f11

This updates publishing to the Central Portal staging API and bumps the publish plugin. No concrete merge-blocking risk was found. The existing Maven Central secrets must be replaced with Central Portal user tokens before the next release.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly identifies the main change: publishing through the Central Portal OSSRH staging API. It is concise and specific.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the build settings with care,
New plugin digits hop into the air.
Central endpoints take their place,
Credentials stay in the same old space.
The burrow hums; the changes are done,
And off hops the rabbit, pleased with the run.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: fc73ea9a-f39e-43c9-b678-d0bf07ceaee1
Commits

Reviewing files that changed from the base of the PR and between 25f5835 and c9f11cf.

Files selected for processing: 1

  • build.gradle

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

@joalves joalves left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml runs ln -s /usr/local/bin/gpg /usr/local/bin/gpg2. On ubuntu-latest, gpg is in /usr/bin, so that link probably points at nothing.
  • useGpgCmd() calls gpg2 unless signing.gnupg.executable is set, so signing would fail with "gpg2 not found". That's unless the GRADLE_PROPERTIES secret sets signing.gnupg.executable=gpg. I can't read the secret, so I can't tell.

Possible fixes, any of which would do:

  1. Add signing.gnupg.executable=gpg to GRADLE_PROPERTIES, or pass -Psigning.gnupg.executable=gpg in the workflow, and drop the ln -s line.
  2. Switch to in-memory signing (useInMemoryPgpKeys(key, password) from GPG_KEY and GPG_PASSWORD), which doesn't need a gpg binary.

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 joalves left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@joalves
joalves merged commit 8680ce8 into main Nov 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants