You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jan_bar <he...@yahoo.com> on 2005/09/29 16:34:59 UTC

jelly variables scope

Hi,

what is the scope of variable in Jelly script? For instance, I want to skip
JUnit tests in cacuts:test, is the following Jelly correct?

<!-- skip JUnit tests during cactus test -->
<preGoal name="cactus:test">
<j:set var="maven.test.skip.old-value" value="${maven.test.skip}" />
<j:set var="cactus.test.skip.old-value" value="${cactus.test.skip}" />
<j:set var="maven.test.skip" value="true" />
<j:set var="cactus.test.skip" value="false" />
</preGoal>

<postGoal name="cactus:test">
<j:set var="maven.test.skip" value="${maven.test.skip.old-value}" />
<j:set var="cactus.test.skip" value="${cactus.test.skip.old-value}" />
</postGoal>

Couple of questions:
* do I need to store/restore the values of variables or, when the goal
exits, all variables will be reverted to previous state?
* should I delete the temp variables with <j:remove>?
* maybe <j:scope> will handle this better?

Thanks, Jan

PS: Unfortunately, there is almost no documentation besides
http://jakarta.apache.org/commons/jelly/tags.html.




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


Re: jelly variables scope

Posted by Dion Gillard <di...@gmail.com>.
On 9/30/05, jan_bar <he...@yahoo.com> wrote:
> Hi,
>
> what is the scope of variable in Jelly script? For instance, I want to skip
> JUnit tests in cacuts:test, is the following Jelly correct?
>
> <!-- skip JUnit tests during cactus test -->
> <preGoal name="cactus:test">
> <j:set var="maven.test.skip.old-value" value="${maven.test.skip}" />
> <j:set var="cactus.test.skip.old-value" value="${cactus.test.skip}" />
> <j:set var="maven.test.skip" value="true" />
> <j:set var="cactus.test.skip" value="false" />
> </preGoal>
>
> <postGoal name="cactus:test">
> <j:set var="maven.test.skip" value="${maven.test.skip.old-value}" />
> <j:set var="cactus.test.skip" value="${cactus.test.skip.old-value}" />
> </postGoal>
>
> Couple of questions:
> * do I need to store/restore the values of variables or, when the goal
> exits, all variables will be reverted to previous state?

Variables are not automatically reverted after a goal to their previous state.

> * should I delete the temp variables with <j:remove>?
Only if you want to get rid of them.

> * maybe <j:scope> will handle this better?

Nope, the scope tag introduces a new scope for it's body only. This
would be hard to write in xml and still have the goal tags in the
right place.

>
> Thanks, Jan
>
> PS: Unfortunately, there is almost no documentation besides
> http://jakarta.apache.org/commons/jelly/tags.html.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
http://www.multitask.com.au/people/dion/
"You are going to let the fear of poverty govern your life and your
reward will be that you will eat, but you will not live." - George
Bernard Shaw

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