Howdy,

I am a bit uncertain if I correctly understand your problem: so you have
several MavenPluginManager implementations in several extensions, and those
extensions are not compatible with each other?

Could we step back a little and could you explain what your extension is
doing? Best if you could show us some sources?

HTH
Tamas



On Tue, Jun 28, 2022 at 10:18 AM François Guillot <
francoisguillo...@gmail.com> wrote:

> Hi,
>
> I need to override some default Maven bindings in my custom extension, for
> instance "org.apache.maven.plugin.MavenPluginManager"
>
> I'm doing this by providing a "META-INF/plexus/components.xml" in my
> extension's jar with
> <<
>
> <?xml version="1.0" encoding="UTF-8"?>
> <component-set>
>   <components>
>     <component>
>       <role>org.apache.maven.plugin.MavenPluginManager</role>
>       <implementation>com.acme.MyMavenPluginManager</implementation>
>
>     </component>
>   </components>
> </component-set>
>
> >>
>
> This works fine, but this has limitations.
> If for some reasons, my extension is applied twice or more to the build,
> then all of these applications will override the Maven core binding. My
> finding is that the last application wins.
> This can be problematic if the user is applying several _versions_ of my
> extension (probably unknowingly), because the overridden MavenPluginManager
> might be coming from a version of my extension that is not compatible with
> the code in the other one.
>
> Is there a more programmatic way to override Maven core bindings, that
> would allow me to decide whether a given extension should perform the
> override or not ?
>

Reply via email to