title: Replace plexus component in Maven 3
body: <p>I need to replace some Maven default functionality with my own implementation, and I am looking for a clean way to do that.</p>
  
  <p>I have extended <code>org.apache.maven.repository.internal.DefaultVersionRangeResolver</code> and registered my extended component using a component.xml as follows:</p>
  
  <pre><code>&lt;component-set&gt;
      &lt;components&gt;
          &lt;component&gt;
              &lt;role&gt;org.sonatype.aether.impl.VersionRangeResolver&lt;/role&gt;
              &lt;role-hint&gt;default&lt;/role-hint&gt;
              &lt;implementation&gt;com.my.custom.VersionRangeResolver
              &lt;/implementation&gt;
              &lt;isolated-realm&gt;false&lt;/isolated-realm&gt;
              &lt;requirements&gt;
                  &lt;requirement&gt;
                      &lt;role&gt;org.sonatype.aether.spi.log.Logger&lt;/role&gt;
                      &lt;role-hint /&gt;
                      &lt;field-name&gt;logger&lt;/field-name&gt;
                  &lt;/requirement&gt;
                  &lt;requirement&gt;
                      &lt;role&gt;org.sonatype.aether.spi.log.Logger&lt;/role&gt;
                      &lt;role-hint /&gt;
                      &lt;field-name&gt;logger2&lt;/field-name&gt;
                  &lt;/requirement&gt;
                  &lt;requirement&gt;
                      &lt;role&gt;org.sonatype.aether.impl.MetadataResolver&lt;/role&gt;
                      &lt;role-hint /&gt;
                      &lt;field-name&gt;metadataResolver&lt;/field-name&gt;
                  &lt;/requirement&gt;
              &lt;/requirements&gt;
          &lt;/component&gt;
      &lt;/components&gt;
  &lt;/component-set&gt;
  </code></pre>
  
  <p>I have installed the project that contains this in my local repo, and I reference it like this in another project's pom.xml:</p>
  
  <pre><code>&lt;build&gt;
      &lt;extensions&gt;
          &lt;extension&gt;
              &lt;groupId&gt;my.groupId&lt;/groupId&gt;
              &lt;artifactId&gt;maven-version-resolver&lt;/artifactId&gt;
              &lt;version&gt;SNAPSHOT&lt;/version&gt;
          &lt;/extension&gt;
      &lt;/extensions&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>However, my artifact is not used. When I run this little GMaven groovy script inside the build:</p>
  
  <pre><code>session.container.getComponentDescriptorList(
      'org.sonatype.aether.impl.VersionRangeResolver'
  ).each{
      println "Role Hint: ${it.roleHint}, implementation: ${it.implementation}" ;
  }
  </code></pre>
  
  <p>it shows me both the default implementation and my own implementation, both with the hint 'default'. So how can I solve this?</p>
  
  <ul>
  <li>Do I need to set an additional parameter in the components.xml (perhaps a higher priority)?</li>
  <li>Do I need to write my component as a Maven Plugin and actively register the component programmatically?</li>
  <li>Is there any Plexus documentation that covers this?</li>
  </ul>