GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-1857: Include all repository failures in artifact messages by efegokdemir · Pull Request #2186 · apache/maven-resolver

Conversation

@efegokdemir

@efegokdemir efegokdemir commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What

Include the per-repository failures for unresolved artifacts in ArtifactResolutionException messages. The primary cause and existing message format remain unchanged when there is only one failure.

Why

When artifact resolution fails for different reasons across repositories, the exception message currently reports only one cause. For example, a missing artifact in Central can be hidden by a transfer error from another repository, leaving users without the information needed to distinguish a bad coordinate from an unavailable repository.

How

Keep the current primary cause selection, then append other recorded failures with the artifact and repository ID. Sort those additional details so the message is stable despite the concurrent map used to store repository failures.

Fixes #1857

Testing

  • Fail-before: the regression test failed on the unmodified implementation because the exception message contained the transfer failure but omitted Central's not-found reason.
  • Pass-after: mvn -pl maven-resolver-api,maven-resolver-impl -am -Dspotless.apply.skip=true -Dspotless.check.skip=true test — 583 tests passed, 5 skipped.
  • mvn -pl maven-resolver-api spotless:check — passed.
  • git diff --check — passed.

The reactor tests ran with Java 25; Spotless was verified separately with Java 17 because the configured formatter is incompatible with Java 25.

Compatibility

Single-failure messages are unchanged and covered by a regression assertion. Successful resolution behavior is unchanged.

AI assistance was used for analysis and implementation; the patch and tests were reviewed before submission.


To make clear that you license this contribution under the Apache License Version 2.0, January 2004, check one of the following:

  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
  • I hereby declare that I have filed an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@efegokdemir
apacheGH-1857: Include all repository failures in artifact messages
18d84d6
Signed-off-by: Efe Gökdemir <[email protected]>
gnodet-bot
gnodet-bot reviewed Oct 8, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good improvement to the artifact resolution error messages. The approach of collecting additional failures separately from the primary cause, using reference-equality identity (exception != primaryCause) to avoid duplication, and sorting for deterministic output is well-reasoned and correct.

Two minor points below.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

gnodet-bot
gnodet-bot reviewed Oct 8, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good improvement to the artifact resolution error messages. The approach of collecting additional failures separately from the primary cause, using reference-equality identity (exception != primaryCause) to avoid duplication, and sorting for deterministic output is well-reasoned and correct.

Two minor points below.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@efegokdemir
test: assert complete artifact failure message
74618f5
Signed-off-by: Efe Gökdemir <[email protected]>
@efegokdemir

efegokdemir commented Oct 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Addressed both suggestions in 74618f5: the accumulator is typed to List<String>, and the regression now asserts the complete formatted message, including the primary cause exactly once and the additional repository failure. mvn -pl maven-resolver-api -Dtest=RepositoryExceptionTest -Dspotless.apply.skip=true -Dspotless.check.skip=true test passed (17 tests), and git diff --check passed. mvn -pl maven-resolver-api spotless:check passed under JDK 17. (The initial JDK 27 run hit a formatter/JDK incompatibility.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnodet-bot
gnodet-bot reviewed Oct 8, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after the new commit.

Addressed: ✅ The assertEquals suggestion was applied — the test now asserts the exact message string, including the single-failure regression case and the ordering-invariance check. Pre-fix validation confirmed the test was failing before the fix and passes after.

Not addressed: The ArrayList<String> nit from the previous review remains open (see inline comment below).

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cstamas

cstamas commented Oct 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Nit: I would tell you exactly the opposite as @gnodet told, given we talk about local variable; my pet peeve is to stick closest to the type as possible 😄 No changes or anything needed, just an observation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cstamas
cstamas approved these changes Oct 8, 2026
View reviewed changes
@gnodet

gnodet commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Nit: I would tell you exactly the opposite as @gnodet told, given we talk about local variable; my pet peeve is to stick closest to the type as possible 😄 No changes or anything needed, just an observation.

Use 'var' ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cstamas cstamas added the enhancement New feature or request label Oct 12, 2026
@cstamas cstamas added this to the 2.0.25 milestone Oct 12, 2026
@cstamas
cstamas merged commit dbfe933 into apache:master Oct 12, 2026
20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned cstamas Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes
+1 more reviewer
@gnodet-bot gnodet-bot gnodet-bot left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

enhancement New feature or request

Projects

None yet

Milestone

2.0.25

Development

Successfully merging this pull request may close these issues.

Improve exception message from ArtifactResolutionException if multiple remote repos failed to resolve an artifact (for different reasons)

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@efegokdemir @cstamas @gnodet @gnodet-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.