Skip to content

build: migrate Maven Central publishing to the Sonatype Central Portal#5

Merged
david-streamlio merged 1 commit into
mainfrom
central-portal-publishing
Jul 6, 2026
Merged

build: migrate Maven Central publishing to the Sonatype Central Portal#5
david-streamlio merged 1 commit into
mainfrom
central-portal-publishing

Conversation

@david-streamlio

Copy link
Copy Markdown
Collaborator

Why

The pom still deploys via nexus-staging-maven-plugin to s01.oss.sonatype.org, which was decommissioned with OSSRH in 2025. The v2.1.1 release (Nov 2025) tagged and branched fine but never reached Maven Central — the deploy failure was silently swallowed by mvn deploy || true in the old release tooling. The latest version on Central is still 2.1.0.

This unblocks publishing 2.9.0 (matching nifi.version 2.9.0) to Maven Central.

What

  • pom.xml
    • Replace nexus-staging-maven-plugin (server id ossrh, dead s01 URLs) with org.sonatype.central:central-publishing-maven-plugin 0.11.0 (server id central, autoPublish).
    • Remove the s01 <distributionManagement> block.
    • Explicitly disable the nexus-staging deploy that the Apache NiFi parent pom injects (aimed at repository.apache.org) — with our local declaration gone it would otherwise hijack the deploy phase.
  • release.yml
    • Enable the previously commented-out central-deploy job. It uses the org-level secrets already shared with this repo: SONATYPE_USERNAME/SONATYPE_PASSWORD (Central Portal token, same server id central streamnative-ci uses) and GPG_PRIVATE_KEY/GPG_PRIVATE_KEY_PASSPHRASE for signing. No new secrets required.
    • The job runs on v* tag pushes alongside the existing GitHub-release and GHCR-image jobs, stamps the pom version from the tag, and excludes the docker-image module from the Central bundle.

Verification

  • mvn clean install -DskipTests -Dgpg.skip=true -pl '!docker-image' passes with the migrated pom.
  • mvn deploy -DskipPublishing=true ... dry run: central-publishing:publish owns the deploy phase for all six modules (parent pom included — the root maven.deploy.skip=true doesn't affect the new plugin), with no nexus-staging execution.

Release plan (after merge)

Push tag v2.9.0release.yml produces the GitHub release with NARs, the ghcr.io/streamnative/nifi image, and the signed Maven Central publish of 2.9.0.

🤖 Generated with Claude Code

The pom still deployed via nexus-staging-maven-plugin to
s01.oss.sonatype.org, which was decommissioned with OSSRH in 2025 —
the v2.1.1 release tagged fine but never reached Maven Central because
the CI deploy failure was silently swallowed. Latest version on
Central is still 2.1.0.

- Replace nexus-staging-maven-plugin/ossrh with
  central-publishing-maven-plugin 0.11.0 (server id `central`,
  autoPublish) and drop the dead s01 distributionManagement block.
- Explicitly disable the nexus-staging deploy injected by the Apache
  NiFi parent pom (aimed at repository.apache.org), which would
  otherwise hijack the deploy phase.
- Enable the central-deploy job in release.yml using the org-level
  SONATYPE_* (Central Portal token) and GPG_* secrets already shared
  with this repo. It runs on v* tag pushes alongside the GitHub
  release and GHCR image jobs.

Verified locally: full build passes and a `deploy -DskipPublishing`
dry run stages all six artifacts (parent pom included) through the
central-publishing plugin with no nexus-staging interference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@david-streamlio david-streamlio merged commit c7550e6 into main Jul 6, 2026
2 checks passed
@david-streamlio david-streamlio deleted the central-portal-publishing branch July 6, 2026 17:12
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