Resolve ANT with Dollar Signs ($$) on Variables

Quick little tip. On my Ant deployment script for Salesforce I run into an issue where my password which was assigned to a variable contained double dollar sign characters. Ant would by default strip out any string with ‘$$’ sign into ‘$’ because it was expecting a value.

This caused my password to stop working.

I ended up breaking my password into two variables.

from

sf.password = time$$machine

to

sf.password = time$

sf.password2 = machine

Then on my build.xml file, I created a new property to store the dollar value and updated the passwordToken property.

<property name="dollar" value="$" />
<property name="passwordToken" value="${sf.password}${dollar}{sf.password2}${sf.token}"/>

That is the post for the day.

Leave a Reply

Your email address will not be published. Required fields are marked *