Skip to content

Conversation

@ortizjeronimo
Copy link
Contributor

Why

  • OSSRH is deprecated; Sonatype Central Portal is the current path.
  • Old [email protected] couldn’t import GPG keys and relied on legacy defaults.

What changed

Build & Publish

  • Added org.sonatype.central:central-publishing-maven-plugin to pom.xml.
  • Removed legacy OSSRH staging flow (nexus-staging-maven-plugin) and any distributionManagement pointing to ossrh.
  • Kept required attachers: maven-source-plugin, maven-javadoc-plugin, maven-gpg-plugin.

GitHub Actions

  • Upgraded to actions/setup-java@v4.
  • Explicitly set OpenJDK distribution to Temurin.
  • Wired Central creds directly in setup-java@v4 so no wrapper envs are needed at deploy time.
  • Deploy step runs only on tags v*.

Settings

  • settings.xml: switched server id from ossrh → central.
  • Credentials and passphrase are still provided via GitHub secrets (no secrets in repo).

Security

  • Secrets used: OSSRH_USER_TOKEN, OSSRH_PWD_TOKEN (now holding Central Portal token pair), GPG_SIGNING_KEY (base64, ascii-armored), GPG_PWD.
  • Secrets remain masked and are only consumed on the runner.

Developer impact

  • No code changes required to consume the library.
  • Local builds unchanged; to publish locally you still run mvn deploy (with proper settings.xml and keyring).

CI behavior after merge

  • Every push builds & tests.
  • Publish to Maven Central occurs only when pushing a tag starting with v (e.g., v0.12.1).

To do

  • Update secrets names to avoid confusion

@ortizjeronimo ortizjeronimo self-assigned this Nov 11, 2025
@ortizjeronimo ortizjeronimo merged commit 352b63a into main Nov 12, 2025
1 check passed
@ortizjeronimo ortizjeronimo deleted the chore/migrate-workflow-to-mvn-central branch November 12, 2025 12:30
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.

3 participants