You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brett Porter <bp...@f2network.com.au> on 2004/04/22 01:37:56 UTC

RE: [Q] Setting a property so that it's visible from another plug in

While plugin.getPluginContext works, it relies on the plugin being
initialised. You can do that by declaring a dummy tag in the plugin (the
dependency handle, and most importantly, adding the uri to your names space
in the calling plugin).

An easier way is to use maven:pluginVar as it will initialise the plugin if
it hasn't been already and you can avoid the dependency handle bit
altogether.

- Brett

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com] 
> Sent: Thursday, 22 April 2004 12:58 AM
> To: 'Maven Developers List'
> Subject: [Q] Setting a property so that it's visible from 
> another plugin
> 
> 
> Hi,
> 
> I used to know how to do this but somehow it's not working 
> anymore for (I'm using RC3). I have 2 plugins one of them is 
> calling the other through attainGoal. The calling plugin also 
> sets a property that is supposed to be visible from the other plugin.
> 
> I've tried without success the following:
> 
> <j:set var="maven.abbot.src.files" value="${infile}" scope="parent"/>
> 
> and
> 
> ${plugin.getPluginContext('maven-abbot-plugin').setVariable('m
> aven.abbot
> .src.files',infile)}
> 
> In the called plugin I simply do an echo like this:
> 
> <echo>value = ${maven.abbot.src.files}</echo>
> 
> The result is "value = " (i.e. no value printed).
> 
> Any idea?
> 
> Thanks
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

RE: [Q] Setting a property so that it's visible from another plugin

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Brett Porter [mailto:bporter@f2network.com.au]
> Sent: 22 April 2004 01:38
> To: 'Maven Developers List'
> Subject: RE: [Q] Setting a property so that it's visible from another
> plugin
> 
> While plugin.getPluginContext works, it relies on the plugin being
> initialised. You can do that by declaring a dummy tag in the plugin
(the
> dependency handle, and most importantly, adding the uri to your names
> space
> in the calling plugin).
> 

ok thanks. I'll try this.

Do you know why the <j:set var="maven.abbot.src.files" value="${infile}"
scope="parent"/> doesn't work. The parent scope should point to a Jelly
context inherited by both plugins, no? Maybe I need to do a
findVariable() instead of getVariable() to get the property from the
called plugin. I will try this too.

> An easier way is to use maven:pluginVar as it will initialise the
plugin
> if
> it hasn't been already and you can avoid the dependency handle bit
> altogether.

Yep, but this is only to get properties, not to set them. Do you that I
could use it indirectly to load the plugin?

Thanks
-Vincent

> 
> - Brett
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol@pivolis.com]
> > Sent: Thursday, 22 April 2004 12:58 AM
> > To: 'Maven Developers List'
> > Subject: [Q] Setting a property so that it's visible from
> > another plugin
> >
> >
> > Hi,
> >
> > I used to know how to do this but somehow it's not working
> > anymore for (I'm using RC3). I have 2 plugins one of them is
> > calling the other through attainGoal. The calling plugin also
> > sets a property that is supposed to be visible from the other
plugin.
> >
> > I've tried without success the following:
> >
> > <j:set var="maven.abbot.src.files" value="${infile}"
scope="parent"/>
> >
> > and
> >
> > ${plugin.getPluginContext('maven-abbot-plugin').setVariable('m
> > aven.abbot
> > .src.files',infile)}
> >
> > In the called plugin I simply do an echo like this:
> >
> > <echo>value = ${maven.abbot.src.files}</echo>
> >
> > The result is "value = " (i.e. no value printed).
> >
> > Any idea?
> >
> > Thanks
> > -Vincent
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >


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