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

 

Reply via email to