efegokdemir opened a new pull request, #2186:
URL: https://github.com/apache/maven-resolver/pull/2186

   ## 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](https://www.apache.org/licenses/LICENSE-2.0), check 
one of the following:
   
   - [x] I hereby declare this contribution to be licensed under the [Apache 
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
   - [ ] I hereby declare that I have filed an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to