[ http://jira.codehaus.org/browse/MANTRUN-36?page=comments#action_54410 ] 

Gilles Scokart commented on MANTRUN-36:
---------------------------------------

 In have found in the reason in the code.

 When a property ${...} is placed into an XML text, the value is not processed 
by the PluginParameterExpressionEvaluator.  
 The text is thus given as is to ant, that forward it to the AntPropertyHelper 
provided by the antrun mojo.  It works as expected.
 
 When a property ${...} is placed alone in an attribute, the 
PluginParameterExpressionEvaluator evaluate it to null, the AntTargetConverter 
of
 the antrun plugin detect this null, and forward the original ${} to ant.  It 
works as expected.
 
 When a property ${...} is placed with some text into an attribute (for example 
"a text ${x}"), the PluginParameterExpressionEvaluator evaluate it to a string
 containing  "a text null", the AntTargetConverter of the antrun plugin forward 
this text to ant that doesn't detect a property.  It is the bu I have found.
 
 The solution is to not use the PluginParameterExpressionEvaluator before, but 
only after ant property processing (into the AntPropertyHelper).

> Esccape property replacement inside quote
> -----------------------------------------
>
>          Key: MANTRUN-36
>          URL: http://jira.codehaus.org/browse/MANTRUN-36
>      Project: Maven 2.x Antrun Plugin
>         Type: Bug

>     Reporter: Gilles Scokart
>  Attachments: ant.xml, pom.xml
>
>
> The propoerties placed not alone inside quotes are not correctly interpreted. 
>  For example : 
> <property name="myProp"       value="OK" />
> <echo message="alone in quote :"/>
> <echo message="${myProp}"/>
> <echo>not alone in text ${myProp}.</echo>
> <echo message="not alone in quote ${myProp}."></echo>
> <fail unless="myProp"/>
> Succeed and print : 
>      [echo] alone in quote :
>      [echo] OK
>      [echo] not alone in text OK.
>      [echo] not alone in quote null.
> While executed directly into ant prints :
>      [echo] alone in quote :
>      [echo] OK
>      [echo] not alone in text OK.
>      [echo] not alone in quote OK.
> You can find in attachment the pom.xml and the ant.xml I used.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to