ikxeno opened a new pull request, #13471:
URL: https://github.com/apache/maven/pull/13471

   Fixes #13469.
   
   I ran into this while working on `mvnval`. When `ApiRunner` requests an 
unqualified `Session`, the standalone injector can return mvnup's named 
provider instead of the default one. Both have the same priority, so the result 
depends on iteration order. If mvnup's provider wins, `ApiRunner` loses the 
requested local repository.
   
   The injector now prefers the default binding when priorities tie on an 
unqualified lookup. If two default bindings still tie, it reports the 
ambiguity. It also collapses repeat registrations of the same provider without 
hiding distinct providers from `List<T>` and `Map<String, T>` injection.
   
   I added tests for these cases, including an `ApiRunner` test with the named 
`Session` registered first. The `mvnval` tests also pass.
   
   Validation: `mvn -B -q -o -pl impl/maven-cli -am test 
'-Dtest=ValidateInvokerTest*,BindingSelectionTest,ApiRunnerSettingsTest' 
-Dsurefire.failIfNoSpecifiedTests=false -Drat.skip=true`
   
   ---
   
   - [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).


-- 
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