Skip to content

Keep the publish credentials on Maven 3.10 - #207

Merged
Sekator778 merged 1 commit into
masterfrom
fix/publish-credentials-maven-3.10
Oct 17, 2026
Merged

Sekator778 merged 1 commit into
masterfrom
fix/publish-credentials-maven-3.10

Conversation

@Sekator778

@Sekator778 Sekator778 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

The publish job fails with a 401 since the runner image moved to Maven 3.10.0 (run 38124855884, after #205). Maven 3.10 offers the credentials of server central only to repo.maven.apache.org, and the upload goes to central.sonatype.com. -Dmaven.repository.credentialScope=id matches the server by id again, as Maven's warning suggests. Checked against a local listener on 3.9.16 and 3.10.0; the proof is the publish run after the merge.


Summary by cubic

Fixes the Maven publish job returning 401 because Maven 3.10 limits the central server credentials to repo.maven.apache.org, while artifacts upload to central.sonatype.com.

Adds -Dmaven.repository.credentialScope=id so the server is matched by id again. Maven 3.9 ignores the property, so older runners are unaffected.

Written for commit e7cd3a6. Summary will update on new commits.

View guided diff Turn on auto-fix

The runner image now ships Maven 3.10.0, which offers the credentials of
server 'central' only to repo.maven.apache.org, so the snapshot upload to
central.sonatype.com is refused with a 401. With
maven.repository.credentialScope=id the server is matched by id again;
Maven 3.9 ignores the property.
@Sekator778
Sekator778 requested a review from Thorsrud22 October 11, 2026 09:09

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 1 file

View guided diff | Turn on auto-fix | Re-trigger cubic

@Thorsrud22 Thorsrud22 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.

The run log matches: 38124855884 has Maven's warning "Not using credentials of server 'central' for repository https://central.sonatype.com/", followed by the 401 on the snapshot upload. The flag is the second of the two options that warning offers; the first (<repositoryOrigins>) would mean replacing the settings.xml that setup-java generates, so the flag is the smaller change. The job only has the one server, so id-only matching doesn't widen anything here. Release uploads use the same server id, so this covers them too.

I haven't reproduced it locally, so the check is the publish run after the merge, as you say. LGTM.

@Sekator778
Sekator778 merged commit ebb48ee into master Oct 17, 2026
5 checks passed
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