If anybody is interested, I have found a solution, but I don't think it's
ideal.  I have done the following in my plugin.properties file:

maven.myplugin.template.repository=${plugin.resources}
maven.genapp.template.repository=\
    ${pom.getPluginContext('maven-myplugin-plugin')\
        .getVariable('maven.myplugin.template.repository')}
maven.genapp.template=mytemplate

This leverages the fact that properties are not immediately resolved (as I
thought they were).  However, I think the getPluginContext method is
deprecated in favor of using the <maven:set> tag.  Obviously I can't use a
tag as the value of a property, so is there any way to do what my property
settings do above, but without using the getPluginContext method?

> -----Original Message-----
> From: Chuck Daniels [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 26, 2004 9:33 PM
> To: Maven Users List
> Subject: RE: Passing context between plugins
>
>
> Thanks Brett, but that had no effect.  The genapp plugin still
> doesn't see a
> value for maven.genapp.template.dir when I change j:set to the following:
>
>   <maven:set
>     plugin="maven-genapp-plugin"
>     property="maven.genapp.template.dir"
>     value="${plugin.resources}/mytemplate"/>
>
> So, as an alternative I tried the following:
>
> 1. Added the following setting to my plugin's plugin.properties file (and
> removed the maven:set tag):
>
> maven.genapp.template.dir=${plugin.resources}/mytemplate
>
> 2. Modified my plugin.jelly to the following:
>
> <project xmlns:j="jelly:core">
>   <goal name="call-genapp">
>     <ant:echo>${maven.genapp.template.dir}</ant:echo>
>     <attainGoal name="genapp"/>
>   </goal>
> </project>
>
> This echoes the proper translation of ${maven.genapp.template.dir} to the
> absolute path for to the mytemplate subdirectory in my plugin's
> plugin-resources directory.  However, the same ant:echo call made
> within the
> genapp plugin.jelly script translated
> ${maven.genapp.template.dir} to a path
> within the genapp plugin's directory structure.
>
> This behavior indicates that property values are not evaluated and made
> static, but that they are reevaluated within each context.  That is, the
> maven.genapp.template.dir property is associated with the expression
> ${plugin.resources}/mytemplate and this expression is evaluated
> within each
> context, such that ${plugin.resources} evaluates to my plugin's resources
> directory in the context of my plugin's plugin.jelly script, but then
> evaluates to the genapp's plugin resource directory when evaluated within
> genapp's plugin.jelly script.
>
> This is obviously not the behavior I want.  I want
> maven.genapp.template.dir
> to be evaluated only once in the context of my plugin, then have that same
> value passed through to the genapp plugin.
>
> What's the deal?  Is there any way for me to make that happen?
>
> Thanks,
> Chuck
>
>
> > -----Original Message-----
> > From: Brett Porter [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, May 26, 2004 6:13 PM
> > To: 'Maven Users List'
> > Subject: RE: Passing context between plugins
> >
> >
> > Try...
> >
> > http://maven.apache.org/reference/maven-jelly-tags/tags.html#maven:set
> >
> > > -----Original Message-----
> > > From: Chuck Daniels [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, 26 May 2004 9:31 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Passing context between plugins
> > >
> > >
> > > Hi,
> > >
> > > I'm still very new to the technical workings of Maven, so
> > > please bear with me.  I'm experimenting with building my own
> > > plugin, which invokes the genapp plugin.  From my plugin's
> > > plugin.jelly file, I set a context variable that the genapp
> > > plugin should recognize.  However, when I attempt to attain
> > > the genapp goal from my plugin (after setting the variable),
> > > the genapp plugin doesn't see the value I set.  Here is my
> > > plugin.jelly file:
> > >
> > > <project xmlns:j="jelly:core">
> > >   <goal name="call-genapp">
> > >     <j:set var="maven.genapp.template.dir"
> > > value="${plugin.resources}/mytemplate"/>
> > >     <attainGoal name="genapp"/>
> > >   </goal>
> > > </project>
> > >
> > > I successfully installed my plugin, but when I run the
> > > following command:
> > >
> > >     maven call-genapp
> > >
> > > the genapp plugin doesn't see the value I set for
> > > maven.genapp.template.dir when it executes my plugin's goal.
> > > It thinks the variable has no value.  Is there something I
> > > need to do in order to pass the jelly context from my plugin
> > > to the genapp plugin?  Am I doing something wrong?
> > >
> > > Thanks,
> > > Chuck
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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]


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

Reply via email to