You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by franz see <fr...@gmail.com> on 2007/02/14 17:02:11 UTC

Re: [m2] Configuring a parameter

Good day to you, Jochen,

Get the container by following the "Accessing the Plexus Container" section
of [1]. Then do the look up.

Cheers,
Franz

[1] http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook


Jochen Wiedmann wrote:
> 
> Hi,
> 
> I have a Mojo, where I would like to only depend on the Plexus role
> (say "MyComponent"). I would want the user to select and configure the
> actual implementation by specifying the role-hint
> and the configuration. For example, I could imagine that this looks like
> 
>     <plugin>
>        <groupId>...</groupId>
>        <artifactId>...</artifactId>
>        <configuration>
>           <param1>...</param1>
>           ...
>           <MyComponentParam>
>              <roleHint>foo</roleHint>
>              <configuration>
>                  ...
>              </configuration>
>           </MyComponentParam>
>        </configuration>
>     </plugin>
> 
> Can anybody advise me how I achieve that? Or better, give an example
> where something like that is done?
> 
> Thanks,
> 
> Jochen
> 
> -- 
> How fast can a year go? As fast as your childs first year.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Configuring-a-parameter-tf3227111s177.html#a8967789
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Configuring a parameter

Posted by franz see <fr...@gmail.com>.
Good day to you, Jochen,

On top of my head, I suggest you accept as a parameter to your mojo a file
path to the components.xml, which would be used to configure your component.
Not sure though how to  load such things to the plexus container.

Also, you may want to try and create other artifacts with the
implementations of MyComponent with different configuration, so that you'd
only have to choose one of those artifacts and set that as a dependency of
your plugin.

Both however are just guesses. I haven't played with plexus much yet. If yo
do find an answer, please feel free to enlighten us :)

Thanks,
Franz


Jochen Wiedmann wrote:
> 
> Hi, Franz,
> 
> On 2/14/07, franz see <fr...@gmail.com> wrote:
> 
>> Get the container by following the "Accessing the Plexus Container"
>> section
>> of [1]. Then do the look up.
>>
>> Cheers,
>> Franz
>>
>> [1] http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook
> 
> thanks for the hint, I wasn't aware of this very helpful document.
> Nevertheless, it only tells me half of the story: I do now know how I
> can create the component. But how do I configure it? Basically I need
> something like the antrun plugin does with its "tasks" parameter: An
> XML element, which can be used to configure the component.
> 
> 
> Thanks,
> 
> Jochen
> 
> 
> -- 
> How fast can a year go? As fast as your childs first year.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Configuring-a-parameter-tf3227111s177.html#a8968143
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Configuring a parameter

Posted by Jochen Wiedmann <jo...@gmail.com>.
Hi, Franz,

On 2/14/07, franz see <fr...@gmail.com> wrote:

> Get the container by following the "Accessing the Plexus Container" section
> of [1]. Then do the look up.
>
> Cheers,
> Franz
>
> [1] http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook

thanks for the hint, I wasn't aware of this very helpful document.
Nevertheless, it only tells me half of the story: I do now know how I
can create the component. But how do I configure it? Basically I need
something like the antrun plugin does with its "tasks" parameter: An
XML element, which can be used to configure the component.


Thanks,

Jochen


-- 
How fast can a year go? As fast as your childs first year.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org