Skip to content

OP-43962: fix(ci): restore snapshot deploy to Maven Central (401) - #2426

Merged
daniel-kmiecik merged 1 commit into
masterfrom
OP-43962
Nov 12, 2026
Merged

daniel-kmiecik merged 1 commit into
masterfrom
OP-43962

Conversation

@daniel-gmc

Copy link
Copy Markdown
Contributor

Problem

Snapshot deploys on v1 fail at central-publishing-maven-plugin:publish with HTTP 401. Tests and compilation pass.

Root cause

Not an expired token. The failing log warns “Not using credentials of server ‘central’ for repository https://central.sonatype.com/repository/maven-snapshots/”. Newer Maven only sends credentials to the origins declared for a server ID. For central that is https://repo.maven.apache.org, so the upload goes out anonymous and Central returns 401.

Changes

server-id: ossrh → central in setup-java.
Add -Dmaven.repository.credentialScope=id to mvn clean deploy, so credentials are sent to the snapshot repo.

Secret names are unchanged.

Verify

On the next push to v1: the “Not using credentials” warning is gone and the deploy step completes without a 401.

Follow-ups

Apply the same change to the 3.0.0 workflow and check its log for the same warning.
Audit other swagger-api repos using central-publishing.
Long term, declare https://central.sonatype.com under in settings.xml instead of the legacy property.
Separate: the Swagger org hit the Central Release Size limit (grace period ends 2026-11-25).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

A live v1 snapshot push is required to verify the updated credential routing against GitHub secrets and Maven Central’s authenticated endpoint, which cannot be confirmed from the checkout alone.

No open issues 🎉

What changed in this PR

Restores authenticated v1 snapshot deployment to Maven Central by aligning the Maven server ID with the Central Publishing configuration and enabling repository-ID credential selection.

Changes:

  • Changes the setup-java server ID from ossrh to central.
  • Adds -Dmaven.repository.credentialScope=id to snapshot deployments.
  • Preserves the existing Maven Central secret mappings.
File Description
.github/​workflows/​maven-v1.yml Updates Java and Maven Central authentication settings for v1 snapshot deployment.

Review effort: Lite

@daniel-kmiecik
daniel-kmiecik merged commit 73fd7c1 into master Nov 12, 2026
8 checks passed
@daniel-kmiecik
daniel-kmiecik deleted the OP-43962 branch November 12, 2026 07:58
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