You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Geoffrey <jc...@hotmail.com> on 2005/05/01 18:15:14 UTC

plugin.jelly: a conditional prereqs

Hi,

Can I do a conditional prereqs in a plugin.jelly?

A goal should be attained conditionally based on a jelly expression, but if
it's already attained in this build it shouldn't be attained either.

-- 
With kind regards,
Geoffrey




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


Re: plugin.jelly: a conditional prereqs

Posted by Thomas Van de Velde <th...@gmail.com>.
But couldn't you do:
 <pregoal name="dist:whatever">
<j:if test="${ithasbeencalled == null}">
${systemScope.setProperty('ithasbeencalled', 'true')}
</j:if>
</pregoal>
 <goal name="whatevergoalthatwantstocalldist">
 <j:if test="${ithasbeencalled != null}">
<attainGoal name="dist:whatever"/>
</j:if>
</goal>

 On 5/5/05, Geoffrey <jc...@hotmail.com> wrote: 
> 
> Another requirement is that I can't control the goal I am prereqing,
> its of the apache maven dist plugin.
> 
> But if attainGoal would support it in the future, that would be the 
> solution
> 
> --
> With kind regards,
> Geoffrey
> 
> "Thomas Van de Velde" <th...@gmail.com> schreef in bericht
> news:6b11487705050210164e5558e0@mail.gmail.com...
> This might work:
> 
> <goal name="only-once">
> <j:if test="${ihavebeencalled == null}">
> ${systemScope.setProperty('ihavebeencalled', 'true')}
> <echo>I am doing this only once</echo>
> </j:if>
> </goal>
> 
> Thomas
> 
> On 5/2/05, Brett Porter <br...@gmail.com> wrote:
> >
> > There is actually a workaround such that you can specify the existing
> > session to the attainGoal tag that has this affect (it can be found in
> > JIRA).
> >
> > - Brett
> >
> > On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> > > right, I missed that requirement..
> > >
> > > actually, come to think of it - one could create a new jelly tag, 
> which
> > > accepts a list of goal names, and attains them if they have not been
> > > attained yet (by using some plugin-context-level variables, which I
> > > assume are retained across the maven session).
> > >
> > > Would that be useful for anyone? Or does m1.1 already deal with that?
> > >
> > >
> > > Brett Porter wrote:
> > >
> > > >That won't suit his requirement about not attaining twice. You can 
> put
> > > >the if statement inside the goal you are prereq'ing though.
> > > >
> > > >- Brett
> > > >
> > > >On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> > > >
> > > >
> > > >>Consider instead of using 'prereqs' to use <attainGoal> instead, 
> like
> > this:
> > > >>
> > > >><goal name="myGoal">
> > > >>
> > > >> <j:if test="...">
> > > >> <attainGoal name="..."/>
> > > >> </j:if>
> > > >>
> > > >></goal>
> > > >>
> > > >>
> > > >>Geoffrey wrote:
> > > >>
> > > >>
> > > >>
> > > >>>Hi,
> > > >>>
> > > >>>Can I do a conditional prereqs in a plugin.jelly?
> > > >>>
> > > >>>A goal should be attained conditionally based on a jelly 
> expression,
> > but if
> > > >>>it's already attained in this build it shouldn't be attained 
> either.
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > >>
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

Re: plugin.jelly: a conditional prereqs

Posted by Geoffrey <jc...@hotmail.com>.
Another requirement is that I can't control the goal I am prereqing,
its of the apache maven dist plugin.

But if attainGoal would support it in the future, that would be the solution

-- 
With kind regards,
Geoffrey

"Thomas Van de Velde" <th...@gmail.com> schreef in bericht
news:6b11487705050210164e5558e0@mail.gmail.com...
This might work:

<goal name="only-once">
<j:if test="${ihavebeencalled == null}">
${systemScope.setProperty('ihavebeencalled', 'true')}
<echo>I am doing this only once</echo>
</j:if>
</goal>

Thomas


On 5/2/05, Brett Porter <br...@gmail.com> wrote:
>
> There is actually a workaround such that you can specify the existing
> session to the attainGoal tag that has this affect (it can be found in
> JIRA).
>
> - Brett
>
> On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> > right, I missed that requirement..
> >
> > actually, come to think of it - one could create a new jelly tag, which
> > accepts a list of goal names, and attains them if they have not been
> > attained yet (by using some plugin-context-level variables, which I
> > assume are retained across the maven session).
> >
> > Would that be useful for anyone? Or does m1.1 already deal with that?
> >
> >
> > Brett Porter wrote:
> >
> > >That won't suit his requirement about not attaining twice. You can put
> > >the if statement inside the goal you are prereq'ing though.
> > >
> > >- Brett
> > >
> > >On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> > >
> > >
> > >>Consider instead of using 'prereqs' to use <attainGoal> instead, like
> this:
> > >>
> > >><goal name="myGoal">
> > >>
> > >> <j:if test="...">
> > >> <attainGoal name="..."/>
> > >> </j:if>
> > >>
> > >></goal>
> > >>
> > >>
> > >>Geoffrey wrote:
> > >>
> > >>
> > >>
> > >>>Hi,
> > >>>
> > >>>Can I do a conditional prereqs in a plugin.jelly?
> > >>>
> > >>>A goal should be attained conditionally based on a jelly expression,
> but if
> > >>>it's already attained in this build it shouldn't be attained either.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>




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


Re: plugin.jelly: a conditional prereqs

Posted by Thomas Van de Velde <th...@gmail.com>.
This might work:

<goal name="only-once">
<j:if test="${ihavebeencalled == null}">
${systemScope.setProperty('ihavebeencalled', 'true')}
<echo>I am doing this only once</echo>
</j:if>
</goal>

Thomas


On 5/2/05, Brett Porter <br...@gmail.com> wrote:
> 
> There is actually a workaround such that you can specify the existing
> session to the attainGoal tag that has this affect (it can be found in
> JIRA).
> 
> - Brett
> 
> On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> > right, I missed that requirement..
> >
> > actually, come to think of it - one could create a new jelly tag, which
> > accepts a list of goal names, and attains them if they have not been
> > attained yet (by using some plugin-context-level variables, which I
> > assume are retained across the maven session).
> >
> > Would that be useful for anyone? Or does m1.1 already deal with that?
> >
> >
> > Brett Porter wrote:
> >
> > >That won't suit his requirement about not attaining twice. You can put
> > >the if statement inside the goal you are prereq'ing though.
> > >
> > >- Brett
> > >
> > >On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> > >
> > >
> > >>Consider instead of using 'prereqs' to use <attainGoal> instead, like 
> this:
> > >>
> > >><goal name="myGoal">
> > >>
> > >> <j:if test="...">
> > >> <attainGoal name="..."/>
> > >> </j:if>
> > >>
> > >></goal>
> > >>
> > >>
> > >>Geoffrey wrote:
> > >>
> > >>
> > >>
> > >>>Hi,
> > >>>
> > >>>Can I do a conditional prereqs in a plugin.jelly?
> > >>>
> > >>>A goal should be attained conditionally based on a jelly expression, 
> but if
> > >>>it's already attained in this build it shouldn't be attained either.
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> > >
> > >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

Re: plugin.jelly: a conditional prereqs

Posted by Brett Porter <br...@gmail.com>.
There is actually a workaround such that you can specify the existing
session to the attainGoal tag that has this affect (it can be found in
JIRA).

- Brett

On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> right, I missed that requirement..
> 
> actually, come to think of it - one could create a new jelly tag, which
> accepts a list of goal names, and attains them if they have not been
> attained yet (by using some plugin-context-level variables, which I
> assume are retained across the maven session).
> 
> Would that be useful for anyone? Or does m1.1 already deal with that?
> 
> 
> Brett Porter wrote:
> 
> >That won't suit his requirement about not attaining twice. You can put
> >the if statement inside the goal you are prereq'ing though.
> >
> >- Brett
> >
> >On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> >
> >
> >>Consider instead of using 'prereqs' to use <attainGoal> instead, like this:
> >>
> >><goal name="myGoal">
> >>
> >>    <j:if test="...">
> >>       <attainGoal name="..."/>
> >>    </j:if>
> >>
> >></goal>
> >>
> >>
> >>Geoffrey wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>
> >>>Can I do a conditional prereqs in a plugin.jelly?
> >>>
> >>>A goal should be attained conditionally based on a jelly expression, but if
> >>>it's already attained in this build it shouldn't be attained either.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
> 
>

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


Re: plugin.jelly: a conditional prereqs

Posted by Arik Kfir <ar...@gmail.com>.
right, I missed that requirement..


actually, come to think of it - one could create a new jelly tag, which 
accepts a list of goal names, and attains them if they have not been 
attained yet (by using some plugin-context-level variables, which I 
assume are retained across the maven session).

Would that be useful for anyone? Or does m1.1 already deal with that?


Brett Porter wrote:

>That won't suit his requirement about not attaining twice. You can put
>the if statement inside the goal you are prereq'ing though.
>
>- Brett
>
>On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
>  
>
>>Consider instead of using 'prereqs' to use <attainGoal> instead, like this:
>>
>><goal name="myGoal">
>>
>>    <j:if test="...">
>>       <attainGoal name="..."/>
>>    </j:if>
>>
>></goal>
>>
>>
>>Geoffrey wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>Can I do a conditional prereqs in a plugin.jelly?
>>>
>>>A goal should be attained conditionally based on a jelly expression, but if
>>>it's already attained in this build it shouldn't be attained either.
>>>
>>>
>>>
>>>      
>>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>

Re: plugin.jelly: a conditional prereqs

Posted by Brett Porter <br...@gmail.com>.
That won't suit his requirement about not attaining twice. You can put
the if statement inside the goal you are prereq'ing though.

- Brett

On 5/2/05, Arik Kfir <ar...@gmail.com> wrote:
> Consider instead of using 'prereqs' to use <attainGoal> instead, like this:
> 
> <goal name="myGoal">
> 
>     <j:if test="...">
>        <attainGoal name="..."/>
>     </j:if>
> 
> </goal>
> 
> 
> Geoffrey wrote:
> 
> >Hi,
> >
> >Can I do a conditional prereqs in a plugin.jelly?
> >
> >A goal should be attained conditionally based on a jelly expression, but if
> >it's already attained in this build it shouldn't be attained either.
> >
> >
> >
> 
>

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


Re: plugin.jelly: a conditional prereqs

Posted by Arik Kfir <ar...@gmail.com>.
Consider instead of using 'prereqs' to use <attainGoal> instead, like this:

<goal name="myGoal">

    <j:if test="...">
       <attainGoal name="..."/>
    </j:if>

</goal>


Geoffrey wrote:

>Hi,
>
>Can I do a conditional prereqs in a plugin.jelly?
>
>A goal should be attained conditionally based on a jelly expression, but if
>it's already attained in this build it shouldn't be attained either.
>
>  
>