I think this is another place where the docs (or the examples in the
docs) don't quite match reality.  I've seen similar problems trying to
access properties/variables in this way, and noticed that code used in
the plugins looked different.  Try something like this:

<j:if test="${context.getVariable('a') == 'yes'}">
   <echo message="Success"/>
</j:if>


-----Original Message-----
From: Vincent Siveton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 05, 2005 6:28 AM
To: 'Maven Users List'
Subject: RE: Maven - IF Tag problem

Hi,

For me its not an issue. 
Let s try to define the variable a as a String:
<j:set var="a">${c}</j:set>

Cheers,

Vincent

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 05, 2005 8:17 AM
> To: users@maven.apache.org
> Subject: Maven - IF Tag problem
> 
> 
> Hi All....
> 
> 
> 
> 
> Problem Statement:
> 
> The condition in the IF tag does not validate correctly, when any 
> variable retrieved from the property file is being used in the 
> condition.
> 
> We tried to retrieve a variable from the property file 
> <<build.properties>> and assign it to another variable so that it can 
> be used in the IF tag for validation.
> 
> The IF tag returns 'True' in false condition and vice versa.
> 
> 
> 
> 
> The maven.xml contains the following code:
> 
> 
> 
> 
> 
> <project default="a" xmlns:j="jelly:core">
> 
> 
> 
> 
>             <goal name="a">
> 
> 
>                         <j:set var="a" value="${c}"/>
> 
> 
>                         <j:if test="${a == 'yes'}">
> 
> 
>                                     <echo message="Success"/>
> 
> 
>                         </j:if>
> 
> 
>             </goal>
> 
> </project>
> 
> 
> 
> 
> 
> The build.properties file contains a name value pair
> 
> 
> 
> 
> c=yes
> 
> 
> 
> 
> Actual Output:
> 
> 
> 
> 
> __  __
> 
> |  \/  |__ _Apache__ ___
> 
> | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
> 
> |_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
> 
> 
> 
> 
> BUILD SUCCESSFUL
> 
> Total time: 1 seconds
> 
> Finished at: Thu May 05 17:15:50 IST 2005
> 
> 
> 
> 
> Expected Output:
> 
> 
> 
> 
> __  __
> 
> |  \/  |__ _Apache__ ___
> 
> | |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
> 
> |_|  |_\__,_|\_/\___|_||_|  v. 1.0.2
> 
> 
> 
> 
> build:start:
> 
> 
> 
> 
> a:
> 
>     [echo] Success
> 
> BUILD SUCCESSFUL
> 
> Total time: 2 seconds
> 
> Finished at: Thu May 05 17:18:29 IST 2005
> 
> 
> 
> 
> Question:
> 
> Please provide some clue to solve this problem
> 
> 
> 
> 
> 
> 
> 
> 
> Confidentiality Notice
> 
> 
> The information contained in this electronic message and any 
> attachments to this message are intended for the exclusive use of the 
> addressee(s) and may contain confidential or privileged information. 
> If you are not the intended recipient, please notify the sender at 
> Wipro or [EMAIL PROTECTED] immediately and destroy all copies of 
> this message and any attachments.


---------------------------------------------------------------------
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