-
Notifications
You must be signed in to change notification settings - Fork 5
Migrate to new Maven Central Portal for publishing #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to new Maven Central Portal for publishing #37
Conversation
Replace legacy OSSRH/Nexus publishing with the new Maven Central Portal: - Replace `io.github.gradle-nexus.publish-plugin` with `tech.yanand.maven-central-publish` - Remove old OSSRH repository configuration - Add `mavenCentral` block for new Central Portal API - Update publish workflow to use `publishToMavenCentralPortal` task - Update GitHub Actions to v4 and add fetch-depth for git-version plugin - Simplify workflow by separating GitHub Packages and Maven Central steps The new publishing requires a `MAVEN_CENTRAL_TOKEN` secret generated from https://central.sonatype.com/account (View Account -> Generate User Token) Fixes PER-13671 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Upgrade Gradle from 7.3.3 to 8.5 for plugin compatibility - Replace legacy nexus-publish plugin with vanniktech/gradle-maven-publish-plugin - Configure Maven Central Portal publishing (CENTRAL_PORTAL host) - Update workflows to use Java 11 for building - Update GitHub Actions to v4 versions - Use standard Gradle project properties for credentials: - ORG_GRADLE_PROJECT_mavenCentralUsername - ORG_GRADLE_PROJECT_mavenCentralPassword - ORG_GRADLE_PROJECT_signingInMemoryKey - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword Required secrets (generate from https://central.sonatype.com/account): - MAVEN_CENTRAL_USERNAME: Username from token generation - MAVEN_CENTRAL_PASSWORD: Password from token generation Fixes PER-13671 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document Maven Central and GitHub Packages publishing process, including credentials setup, Gradle tasks, and troubleshooting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add task dependency fix for plainJavadocJar -> generateMetadataFileForMavenPublication - Remove duplicate withSourcesJar/withJavadocJar (handled by vanniktech plugin) - Add -PskipSigning flag for local testing without GPG keys - Update PUBLISHING.md with skipSigning documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove S01 and DEFAULT publishing types from PUBLISHING.md - Update build.gradle comments to reference maven-publish plugin 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use 2.2.+ version range to auto-select latest patch version - Link to Maven Central for explicit version lookup - Update Javadoc URLs to use /latest/ path 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the SDK's publishing infrastructure from the legacy OSSRH/Nexus system to the new Maven Central Portal to resolve authentication failures. The migration includes upgrading Gradle from 7.3.3 to 8.5 and replacing the Nexus publishing plugin with the Vanniktech Maven publish plugin.
Key changes:
- Replaced publishing plugin and updated to Gradle 8.5 for compatibility
- Updated GitHub Actions workflow to use Java 11 for builds and new publishing tasks
- Added comprehensive publishing documentation with setup instructions
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/wrapper/gradle-wrapper.properties | Upgraded Gradle from 7.3.3 to 8.5 |
| README.md | Updated version references to use flexible version range and latest javadoc links |
| PUBLISHING.md | Added comprehensive guide for Maven Central Portal publishing setup and workflows |
| .github/workflows/publish.yaml | Migrated workflow to Java 11, updated actions to v4, and replaced publishing tasks with new Maven Central Portal commands |
| .github/workflows/javadoc.yaml | Updated Java version to 11 and actions to v4 for consistency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The NEXUS_TOKEN_* secrets contain the Central Portal token credentials. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Migrate from legacy OSSRH/Nexus publishing to the new Maven Central Portal.
Why This is Needed
The current publish workflow fails with 403 Forbidden because Sonatype has transitioned from the legacy OSSRH system to the new Maven Central Portal. The old credentials and API endpoints no longer work.
Changes
Gradle Updates
io.github.gradle-nexus.publish-pluginwithcom.vanniktech.maven.publish(0.28.0)SonatypeHost.CENTRAL_PORTALWorkflow Updates
publishAndReleaseToMavenCentralreplaces oldpublishToSonatype closeAndReleaseSonatypeStagingRepositoryNew Environment Variables
The vanniktech plugin uses Gradle project properties:
Required Setup
Generate User Token from Maven Central Portal:
Add GitHub Secrets:
MAVEN_CENTRAL_USERNAME- Username from tokenMAVEN_CENTRAL_PASSWORD- Password from tokenGPG_SIGNING_KEY- (existing)GPG_SIGNING_PASSPHRASE- (existing)Test Plan
./gradlew build -x testpasses locally./gradlew javadocpasses locallyFixes PER-13671
🤖 Generated with Claude Code