You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Mark D. Hansen" <m....@verizon.net> on 2005/02/10 21:32:47 UTC

simple if-then-else ??

Sorry if this is dumb question, I'm a maven newbie.

How would I do this kind of IF-THEN-ELSE structure?

<goal name=foo-goal">
  <available property="foo.property"
    file="${user.home}/myfile:"/>
  IF (foo.property isset) THEN {
    <exec executable="bar"/>
  } ELSE {
    <exec executable="bar2"/>
}



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


Re: simple if-then-else ??

Posted by Eric Black <eb...@concord.org>.
No Else, have to do

<j:if test="${empty(foo.property)}>
</j:if>
<j:if test="${! empty(foo.property)}>
</j:if>

Word of warning: Don't use 'dotted' variables. There is a bug where
foo.property can't be resolved but if you set a single word variable like
fooProperty ther is no problem. Someone else might know why, but I don't.

Eric



"Maven Users List" <us...@maven.apache.org> on Thursday, February 10, 2005
at 3:32 PM +0000 wrote:
>Sorry if this is dumb question, I'm a maven newbie.
>
>
>How would I do this kind of IF-THEN-ELSE structure?
>
>
><goal name=foo-goal">
>  <available property="foo.property"
>    file="${user.home}/myfile:"/>
>  IF (foo.property isset) THEN {
>    <exec executable="bar"/>
>  } ELSE {
>    <exec executable="bar2"/>
>}
>



RE: simple if-then-else ??

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Mark,

Try:

<j:choose>
  <j:when test="...">
  </j:when>
  <j:otherwise>
  </j:otherwise>
</j:choose>

-Vincent

> -----Original Message-----
> From: Mark D. Hansen [mailto:m.hansen23@verizon.net]
> Sent: jeudi 10 février 2005 21:33
> To: Maven User (E-mail)
> Subject: simple if-then-else ??
> 
> Sorry if this is dumb question, I'm a maven newbie.
> 
> How would I do this kind of IF-THEN-ELSE structure?
> 
> <goal name=foo-goal">
>   <available property="foo.property"
>     file="${user.home}/myfile:"/>
>   IF (foo.property isset) THEN {
>     <exec executable="bar"/>
>   } ELSE {
>     <exec executable="bar2"/>
> }
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


_________________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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