> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: 20 November 2003 04:34
> To: Maven Developers List
> Subject: Re: cvs commit: maven-plugins/caller/xdocs changes.xml
> navigation.xml
> 
> [EMAIL PROTECTED] wrote on 17/11/2003 12:01:08 AM:
> 
> > vmassol     2003/11/16 05:01:08
> >
> >   Modified:    caller   plugin.jelly project.xml
> >                caller/xdocs changes.xml navigation.xml
> >   Log:
> >   - Fixed bug apparently due to some changes in maven core.
> > ${plugin} seems to now reference the calling plugin and not this
plugin.
> >
> [snip]
> 
> >   +          value="${pom.getPluginContext('maven-caller-plugin').
> > findVariable(callProperty)}"/>
> 
> Can we please use the pluginVar tag for these sorts of things instead
of
> relying on pom.getPluginContext...?

I would have but for the fact that pluginVar uses getVariable instead of
findVariable. Are you ok to modify pluginVar to use findVariable
instead?

Also, I've found the need for a common pattern: Some properties are
defined in plugin.properties but users can also override them. I would
like to either modify the pluginVar tag name (and logic) or create a new
one that does:

- look for a property in the pom context first (using findVariable)
- if not found, look for it in a given plugin context (using
findvariable)
- if not found, raise an error

Basically:

    <define:tag name="property">

      <maven:paramCheck value="${property}" 
          message="Missing 'property' attribute" fail="true"/>
      <maven:paramCheck value="${var}" message="Missing 'var' attribute"

          fail="true"/>
      <maven:paramCheck value="${plugin}" message="Missing 'plugin'
attribute" fail="true"/>

      <j:set var="tmp" value="${context.findVariable(property)}"/>
      <j:if test="${empty(tmp)}">
        <j:set var="tmp"
 
value="${pom.getPluginContext(plugin).findVariable(property)}"/>
      </j:if>
      <j:if test="${empty(tmp)}">
        <ant:fail>Property [${property}] is required and cannot be
found.</ant:fail>
      </j:if>
      <j:set var="${var}" value="${tmp}" scope="parent"/>

    </define:tag>

What do you think?

Thanks
-Vincent


> --
> dIon Gillard, Multitask Consulting
> Blog:      http://blogs.codehaus.org/people/dion/
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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