Skip to content

feat(stage-vote-release): target Central Portal OSSRH Staging API - #189

Open
vlsi wants to merge 1 commit into
masterfrom
nexus-central-portal-staging
Open

feat(stage-vote-release): target Central Portal OSSRH Staging API#189
vlsi wants to merge 1 commit into
masterfrom
nexus-central-portal-staging

Conversation

@vlsi

@vlsi vlsi commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Why

Three issues with publishing to Maven Central via the stage-vote-release plugin:

  1. stagingProfileId was never propagated. releaseParams.nexus.stagingProfileId was declared but never wired to the publish plugin's nexus repository, so setting it had no effect. The only workaround was to reconfigure the repository by hand:

    plugins.withId("io.github.gradle-nexus.publish-plugin") {
        configure<NexusPublishExtension> {
            repositories.named("nexus") { stagingProfileId.set("org.postgresql") }
        }
    }
  2. mavenCentral() pointed at oss.sonatype.org, which was sunset in 2025. Users had to override the host to reach the Central Portal OSSRH Staging API compatibility service.

  3. No default stagingProfileId. On the compatibility host the staging profile is the namespace, and the profile_repositories lookup is unsupported (publish-plugin#379), so a sensible default avoids a manual step.

What

  • Propagate releaseParams.nexus.stagingProfileId to the nexus repository.
  • nexus.mavenCentral() now targets the Central Portal OSSRH Staging API compatibility host:
    • staging (nexusUrl) → https://ossrh-staging-api.central.sonatype.com/service/local/
    • snapshots → https://central.sonatype.com/repository/maven-snapshots/
  • New nexus.snapshotUrl property, since the snapshot host no longer matches the staging host. When unset, the plugin keeps deriving it from url.
  • mavenCentral() defaults stagingProfileId to the project group for production releases only. The test environment (asflike-release-environment) and apacheRepository() are unaffected — repository.apache.org still uses its hashed profile and the profile lookup.

After this change the manual workaround above can be dropped; nexus { mavenCentral() } is enough.

How to verify

NexusConfigTest covers all three:

  • mavenCentral targets the Central Portal compatibility host in production — staging/snapshot URLs and stagingProfileId == project.group
  • mavenCentral keeps the local stub in the test environment — local 127.0.0.1 URLs, no default profile
  • explicit stagingProfileId reaches the nexus repository — explicit value is propagated
./gradlew :plugins:stage-vote-release-plugin:check

Docs in plugins/stage-vote-release-plugin/README.md are updated to match.

🤖 Generated with Claude Code

oss.sonatype.org was sunset in 2025, so nexus.mavenCentral() now points the
staging host at the Central Portal OSSRH Staging API compatibility host
(ossrh-staging-api.central.sonatype.com) and snapshots at central.sonatype.com.
Users no longer need to set the compatibility host by hand. A new nexus.snapshotUrl
property carries the snapshot host, since it no longer shares a host with staging.

The compatibility host identifies staging profiles by namespace and does not
support the profile_repositories lookup, so mavenCentral() defaults stagingProfileId
to the project group for production releases. The test environment and
apacheRepository() are unaffected.

Also propagate releaseParams.nexus.stagingProfileId to the publish plugin's nexus
repository; it was declared but never wired up, so an explicit stagingProfileId had
no effect.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant