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