You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by KC Baltz <KC...@Copart.Com> on 2005/09/20 00:20:18 UTC

How to escape ${ in Jelly/Jexl ?

We are in the process of migrating to Maven from Ant and I'm having a bit of trouble replicating in Maven a behavior we have in our Ant build.  We use the Ant filtered copy mechanism where tokens are replaced with values.  The copy task lets you specify your token delimiters and we chose ${ and } to begin and end our tokens respectively.  So I tried to put the following in:
 
        <ant:filterset begintoken="${" endtoken="}" id="build.propertiesFilter"
            description="Used to parse tokens in config files into their associated values in build.properties.">
            <filtersfile file="build.properties"/>
        </ant:filterset>

Maven complains about the value of begintoken because the ${ doesn't have a matching }.  In Ant I escape $ with $$, but that doesn't appear to work here.  I found an ugly workaround like this:
 
    <j:set var="dollar" value="$" />
    
    <ant:filterset begintoken="${dollar}{" endtoken="}" id="build.propertiesFilter"
 
That feels like a hack.  Is there another way? 
 

K.C. Baltz

 

Re: How to escape ${ in Jelly/Jexl ?

Posted by John Fallows <jo...@gmail.com>.
Try

<ant:filterset begintoken="${'${'}" ... >

Kind Regards,
John Fallows.


On 9/19/05, KC Baltz <KC...@copart.com> wrote:
> We are in the process of migrating to Maven from Ant and I'm having a bit of trouble replicating in Maven a behavior we have in our Ant build.  We use the Ant filtered copy mechanism where tokens are replaced with values.  The copy task lets you specify your token delimiters and we chose ${ and } to begin and end our tokens respectively.  So I tried to put the following in:
>
>         <ant:filterset begintoken="${" endtoken="}" id="build.propertiesFilter"
>             description="Used to parse tokens in config files into their associated values in build.properties.">
>             <filtersfile file="build.properties"/>
>         </ant:filterset>
>
> Maven complains about the value of begintoken because the ${ doesn't have a matching }.  In Ant I escape $ with $$, but that doesn't appear to work here.  I found an ugly workaround like this:
>
>     <j:set var="dollar" value="$" />
>
>     <ant:filterset begintoken="${dollar}{" endtoken="}" id="build.propertiesFilter"
>
> That feels like a hack.  Is there another way?
>
>
> K.C. Baltz
>
>
>
>

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