Skip to content

Fix snapshot and release publishing with Maven 3.10 credential scoping - #3940

Merged
uglide merged 1 commit into
mainfrom
fix/maven-central-credential-origins
Oct 9, 2026
Merged

uglide merged 1 commit into
mainfrom
fix/maven-central-credential-origins

Conversation

@uglide

@uglide uglide commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Snapshot publishing has failed with HTTP 401 since the ubuntu-24.04 runner image moved from Maven 3.9.16 to 3.10.0. Maven 3.10 ties server credentials to repository origins. Because the server id central maps to https://repo.maven.apache.org only, Maven stopped sending the Sonatype token to central.sonatype.com. This PR declares the Sonatype origin explicitly, so both the snapshot and release workflows publish again.

Key Decisions & Assumptions

  • A committed .github/maven-settings.xml replaces the server entry that setup-java generated, because setup-java cannot emit <repositoryOrigins>.
  • The credentials gain one extra origin, https://central.sonatype.com, instead of falling back to -Dmaven.repository.credentialScope=id. This keeps Maven 3.10's origin scoping in place.
  • Credentials are still read from MAVEN_USERNAME / MAVEN_PASSWORD, which come from the same secrets as before.

Behavioral / Conceptual Changes

  • The snapshot deploy step and the release Publish to Maven step now run with --settings .github/maven-settings.xml.
  • setup-java no longer configures the central server in either workflow.
  • Older Maven versions ignore the new element, so the settings file also works on Maven 3.9 and earlier.

Notes

  • Verified that local Maven 3.8.7 parses the file and resolves the central credentials. Also checked that the Maven 3.10.0 source adds <repositoryOrigins> entries to the allowed origins. Not yet verified end-to-end on CI; after merging, trigger "Publish Snapshot" manually and confirm the "Not using credentials of server 'central'" warning is gone.
  • Failing run: https://github.com/redis/lettuce/actions/runs/37923745726
  • No issue ticket is referenced yet.

πŸ€– Generated with Claude Code


Note

Low Risk
CI-only Maven settings and workflow wiring; no application runtime or secret handling changes beyond fixing where credentials are applied during deploy.

Overview
Restores snapshot and release publishing after Maven 3.10 on ubuntu-latest stopped sending Sonatype credentials to central.sonatype.com, which caused HTTP 401s.

Adds a committed .github/maven-settings.xml that defines the central server with MAVEN_USERNAME / MAVEN_PASSWORD and explicitly scopes credentials to https://central.sonatype.com via <repositoryOrigins>. Snapshot and release deploy steps now pass --settings .github/maven-settings.xml, and both workflows drop setup-java’s server-id / username / password options because that action cannot emit the origins block.

Reviewed by Cursor Bugbot for commit 0f8d9d1. Bugbot is set up for automated code reviews on this repo. Configure here.

Maven 3.10 binds server credentials to repository origins, and the server
id "central" is implicitly bound to https://repo.maven.apache.org only.
The Sonatype token was therefore no longer sent to central.sonatype.com
and publishing failed with HTTP 401.

Use a committed settings file that declares https://central.sonatype.com
as an allowed origin for the "central" server, in both the snapshot and
release workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review βœ… Completed 2026-10-09T12:01:27.413633Z 0f8d9d1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@uglide
uglide merged commit 84f1d83 into main Oct 9, 2026
10 checks passed
@uglide
uglide deleted the fix/maven-central-credential-origins branch October 9, 2026 12:00
@a-TODO-rov a-TODO-rov mentioned this pull request Oct 13, 2026
a-TODO-rov added a commit that referenced this pull request Oct 16, 2026
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