Thanks Brian for the alternative.  I really do like how the custom enforcer
rules work though, so I think I'm going to follow your lead with the
enforcer rules but I'm glad to know that the role hint can be overridden.

The fact that the "implementation" attribute is available out-of-the-box
with Maven plugins really should be described in detail here under "Other
Object Classes":
http://maven.apache.org/guides/plugin/guide-java-plugin-development.html

It's such a great feature and I'm surprised that I hadn't heard about it
until now!



Brian E Fox wrote:
> 
> Actually the enforcer doesn't show overriding the hint, but the
> ounce-maven-plugin does exactly that. I simply take hint as a parameter
> and use that in the container.lookUp() call. The trick is getting the
> container to use, you need to implement Contextualizable and then the
> method contextualize. Then you grab the container and hold a reference
> to it. If you look at the ounce code, you'll see this happening.
> 
> -----Original Message-----
> From: jaxzin [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 25, 2008 1:13 PM
> To: [email protected]
> Subject: Re: Override an @component hint in the pom?
> 
> 
> Thanks Jason, that's exactly what I'm looking for.
> 
> 
> Jason van Zyl-2 wrote:
>> 
>> You can look at the enforcer plugin and the shade plugin for examples
> 
>> of letting users specify custom/specific implementations of components
> 
>> with their own configurations.
>> 
>> On 24-Jul-08, at 9:50 PM, jaxzin wrote:
>> 
>>>
>>> I'm trying to create a mojo that is itself pluggable so that my  
>>> users can
>>> select an implementation of an interface to use.  I'm reading about  
>>> plexus
>>> and the @component annotation for mojo fields.  It appears the plexus
>>> component's roleHint can only be set in the annotation and not in  
>>> the pom
>>> configuration when someone uses my maven plugin.  Ideally I'd like  
>>> to have
>>> my users specify a class and property values that initialize it in  
>>> an IoC
>>> pattern and have it injected into my Mojo. Am I misunderstanding how
> 
>>> to use
>>> plexus and its not built for this?  Are there any examples of Mojo  
>>> doing
>>> something similar to what I describe, even if its without plexus  
>>> components?
>>> -- 
>>> View this message in context:
>>>
> http://www.nabble.com/Override-an-%40component-hint-in-the-pom--tp186437
> 97p18643797.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>> 
>> Thanks,
>> 
>> Jason
>> 
>> ----------------------------------------------------------
>> Jason van Zyl
>> Founder,  Apache Maven
>> jason at sonatype dot com
>> ----------------------------------------------------------
>> 
>> First, the taking in of scattered particulars under one Idea,
>> so that everyone understands what is being talked about ... Second,
>> the separation of the Idea into parts, by dividing it at the joints,
>> as nature directs, not breaking any limb in half as a bad carver
> might.
>> 
>>    -- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander)
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Override-an-%40component-hint-in-the-pom--tp186437
> 97p18655934.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Override-an-%40component-hint-in-the-pom--tp18643797p18657322.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to