Skip to content

ci: publish to Maven Central through the Central Portal - #287

Merged
HuiJun merged 1 commit into
developfrom
ci/maven-central-portal-publishing
Nov 17, 2026
Merged

HuiJun merged 1 commit into
developfrom
ci/maven-central-portal-publishing

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

oss.sonatype.org no longer accepts uploads: deploy_snapshot fails on develop with HTTP 405, and the tag-triggered deploy_release targets the same host. This moves both jobs to the Central Portal, using the organization's Maven Central CircleCI context (CENTRAL_TOKEN_USERNAME, CENTRAL_TOKEN_PASSWORD, GPG_PRIVATE_KEY, GPG_PASSPHRASE) in place of the project-level OSSRH_* and SIGNING_* variables.

build.gradle

  • Snapshot builds publish to https://central.sonatype.com/repository/maven-snapshots/ with -PcentralUsername / -PcentralPassword.
  • Release builds (-PbuildTag=<version>) publish every module into build/central-staging. The new root task centralBundle zips that directory into build/central/central-bundle.zip, the deployment bundle the Central Publisher API takes. No publishing plugin is added.

.circleci/config.yml

  • deploy_release runs everything that can fail before the upload, because a Central version cannot be replaced:
    1. require the four context variables;
    2. refuse a version that is already on Central;
    3. build and sign the bundle, and check that every .pom has a .pom.asc;
    4. upload with publishingType=AUTOMATIC and poll until the deployment is PUBLISHED (fails on FAILED or after 30 minutes).
  • The signing key is accepted ASCII-armoured or base64-encoded on one line, and reaches Gradle through ORG_GRADLE_PROJECT_signingKey, not the command line.
  • Both deploy jobs now reference context: Maven Central.

Verification

  • ./gradlew -PbuildTag=4.0.20 cleanCentralStaging centralBundle with a throwaway GPG key produces a bundle with all 23 modules; each has a jar, sources jar, javadoc jar, pom, checksums and signatures, and the signatures verify with gpg --verify.
  • circleci config validate passes.
  • Not exercised: the upload itself, the context's credentials, and the snapshot repository. The deploy jobs run only on develop, release branches and tags, so they do not run on this PR.

Before relying on it

  • The Maven Central context must be usable by this project and by whoever pushes the tag.
  • deploy_snapshot needs snapshot publishing enabled for the org.openmbee namespace in the Central Portal; otherwise it keeps failing on develop.

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/d9f10869eb3d4b268da3834fb1b42689
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/d9f10869eb3d4b268da3834fb1b42689?variant=devin
Requested by: @HuiJun


🟢 Devin Review found nothing to fix · View findings

Devin Review

oss.sonatype.org no longer accepts uploads. Releases are staged locally,
zipped by the centralBundle task and uploaded through the Central
Publisher API; snapshots go to the Central Portal snapshot repository.
Credentials and the signing key come from the 'Maven Central' context.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit 849cff0 into develop Nov 17, 2026
4 checks passed
@HuiJun
HuiJun deleted the ci/maven-central-portal-publishing branch November 17, 2026 02:45
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