Overriding defaults

70 views Asked by At

I am currently trying to extend an existing project. Unfortunately I am completely new to plexus. I am greatly Spring biassed, so please tell me if the approach is completely wrong.

Let me describe what I want to do:

In the existing project there is a component with role "A" (Implementation DefaultA) that has a requirement "propertyB" of role "B". In the same components.xml there is a component of role "B" (Implementation DefaultB). This is usually automatically injected into the propertyB property of DefaultA. So far so good.

Now I would like to create a component of role "B" (Implementation SpecialB) provided by a separate jar and make that override the default implementation of "DefaultB".

Is this possible and if yes ... how is it done?

What I am actually trying to do, is to create a ModelValidator as part of the flexmojos maven plugin, which should override the DefaulModelValidator implementation of Maven 3.

Chris

1

There are 1 answers

0
Christofer Dutz On BEST ANSWER

Ok ... so the solution is actually quite easy. If you define a component extending the same interface with the same role-definition and simply place a jar with that component in the MAVEN_HOME/lib/ext directory, your component will be used instead of the default.

Documented this and uploaded a sample maven-project in my companies confluence: https://dev.c-ware.de/confluence/display/PUBLIC/Flexmojos+in+Continuous+Integration+Builds

Chris