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

   ## Problem
   
   When a Maven 4 plugin (e.g. `maven-compiler-plugin 4.x`) declares a 
`@Provides` method for a service (e.g. `ArtifactManager`), and Maven core also 
registers that service via `bindSupplier` in 
`DefaultMavenPluginManager.loadV4Mojo`, two bindings with the same priority (0) 
exist in the injector, causing an `DIException: Ambiguous bindings`.
   
   This was silently ignored in earlier releases but is now detected and 
reported, breaking plugins that use `Providers.java`-style service bridging.
   
   ## Fix
   
   Add a `bindSupplier(Class, Supplier, int priority)` overload to `Injector` / 
`InjectorImpl`, and use it in `loadV4Mojo` with priority `-10` for the session 
services.
   
   This makes the session-provided bindings explicit fallbacks: they are used 
when the plugin does not provide its own `@Provides` for a given service, and 
are silently overridden when it does.
   
   ## Related
   
   Fixes #13911


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