Skip to content

Fix 5.x release: Migrate to Maven Central Publishing API - #1705

Closed
ricardozanini wants to merge 2 commits into
5.xfrom
fix-ci-release-5.x-maven-central
Closed

ricardozanini wants to merge 2 commits into
5.xfrom
fix-ci-release-5.x-maven-central

Conversation

@ricardozanini

Copy link
Copy Markdown
Collaborator

Resolves the 402 Payment Required error when releasing from the 5.x branch.

Problem

The 5.x branch was still using the legacy Sonatype OSSRH publishing endpoint, which now enforces publishing limits with a 402 error. The approved exemption (10 releases, 100 MB, 8160 files monthly for io.serverlessworkflow) only applies to the new Maven Central Publishing API.

Solution

Backported the Maven Central migration from main (originally done in f20021f) to the 5.x branch:

  • Add central-publishing-maven-plugin v0.11.0
  • Update workflow server-id from ossrh to central
  • Remove distributionManagement section (handled by new plugin)
  • Add plugin to active build/plugins section (not just pluginManagement)
  • Simplify release:perform invocation

Testing

After merge, retry releases from 5.x - they should now publish successfully through the new API that respects the exemption limits.

Migrates from legacy Sonatype OSSRH to new Maven Central Publishing API.
This resolves the 402 Payment Required error by using the new publishing
system that respects the approved exemption limits (10 releases, 100 MB,
8160 files monthly for io.serverlessworkflow).

Changes:
- Add central-publishing-maven-plugin v0.11.0
- Update workflow server-id from 'ossrh' to 'central'
- Remove distributionManagement section (handled by new plugin)
- Simplify release:perform invocation

Signed-off-by: GitHub Action <action@github.com>
The plugin was only in pluginManagement, not in the active build/plugins
section, causing maven-deploy-plugin to run instead. This resulted in:
"repository element was not specified in the POM inside distributionManagement"

Moving the plugin configuration to build/plugins ensures it's active during
the release process.

Signed-off-by: GitHub Action <action@github.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 16:29
@ricardozanini

Copy link
Copy Markdown
Collaborator Author

Closing - reopening original PR #1702

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The release workflow’s credential/secrets naming mismatch with the new central server-id creates an avoidable high-risk release misconfiguration unless clarified/adjusted.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Backports the Maven Central Publishing API migration to the 5.x branch to avoid Sonatype OSSRH legacy endpoint limits (402) and ensure releases publish via the new Central Publishing flow.

Changes:

  • Adds org.sonatype.central:central-publishing-maven-plugin and removes legacy distributionManagement OSSRH endpoints in pom.xml.
  • Updates the release workflow to use server-id: central and simplifies the release:perform invocation.
File Description
pom.xml Adds Central Publishing plugin configuration and removes legacy OSSRH distributionManagement configuration.
.github/​workflows/​release.yml Switches Maven credentials server-id to central and simplifies release:perform command.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +54 to 57
mvn -B release:perform -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Comment thread pom.xml
Comment on lines +211 to +221
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${version.org.sonatype.central}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>uploaded</waitUntil>
</configuration>
</plugin>
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