Skip to content

Bind Sonatype credentials to central.sonatype.com origin - #2795

Merged
acoburn merged 1 commit into
mainfrom
sonatype-repository-origins
Nov 4, 2026
Merged

acoburn merged 1 commit into
mainfrom
sonatype-repository-origins

Conversation

@acoburn

@acoburn acoburn commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Maven 3.10 binds server credentials to repository origins, and the central server id defaults to https://repo.maven.apache.org. As a result, credentials are withheld from uploads to central.sonatype.com and the deploy step fails with HTTP 401.

  • Add .github/maven-settings.xml, which declares the central server with the Sonatype origin via <repositoryOrigins>
  • Use that settings file for the deploy step in cd-config.yml
  • Stop setup-java from generating settings.xml (overwrite-settings: false), since it cannot emit <repositoryOrigins>; the GPG passphrase is read by maven-gpg-plugin from MAVEN_GPG_PASSPHRASE

Maven 3.10 binds server credentials to repository origins, and the
'central' server id defaults to https://repo.maven.apache.org. As a
result, credentials were withheld from uploads to central.sonatype.com
and the deploy step failed with HTTP 401.

Add a committed settings file that declares the Sonatype origin via
<repositoryOrigins> and use it for the deploy step. setup-java cannot
generate this element, so it no longer writes settings.xml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@acoburn
acoburn requested a review from a team as a code owner November 4, 2026 21:13
@acoburn
acoburn enabled auto-merge November 4, 2026 21:16
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@acoburn
acoburn added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 9809cc2 Nov 4, 2026
8 checks passed
@acoburn
acoburn deleted the sonatype-repository-origins branch November 4, 2026 21:38
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.

2 participants