You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jake_ryan <sr...@yahoo.com> on 2007/03/01 17:01:36 UTC
Ant filterset doesnot work
I have a property file-1 where cc.db.username and cc.db.password are defined.
There is property file-2 with tokens DbUser and DbPassword with some default
values, that will be copied to a directory.
My task is to replace values of DbUser and DbPassword in file-2 with values
of cc.db.username and cc.db.password in file-1.
I have a code like this:
After running ant, I get successful message but still the copied file
contain old values.
How to debug this? What is wrong with my code?
Thanks a bunch!
--
View this message in context: http://www.nabble.com/Ant-filterset-doesnot-work-tf3327767.html#a9252339
Sent from the Ant - Users mailing list archive at Nabble.com.
Re: [SEC=UNCLASSIFIED] Ant filterset doesnot work
Posted by jake_ryan <sr...@yahoo.com>.
Forgot to mention.. Here are the files:
file-1:
cc.db.username=itsme
cc.db.password=itsme
file-2
DbUser=shared
DbPassword=shared
After running ant, still I see DbUser and DbPassword as shared/shared. I
expected they wouldbe itsme/itsme.
I tried to use begintoken="%" endtoken="*" aswell, but of no use.
jake_ryan wrote:
>
> I have a property file-1 where cc.db.username and cc.db.password are
> defined.
>
> There is property file-2 with tokens DbUser and DbPassword with some
> default values, that will be copied to a directory.
>
> My task is to replace values of DbUser and DbPassword in file-2 with
> values of cc.db.username and cc.db.password in file-1.
>
> I have a code like this:
> <echo message="Copying SPP_CC config file to
> ${jboss.local.conf.dir}"></echo>
> <copy file="${cc.config.files.dir}/SPP_CC_Config.properties"
>
> tofile="${jboss.local.conf.dir}/SPP_CC_Config.properties" filtering="on">
> <filterset>
> <filter token="DbUser" value="${cc.db.username}"/>
> <filter token="DbPassword" value="${cc.db.password}"/>
> </filterset>
> </copy>
>
> After running ant, I get successful message but still the copied file
> contain old values.
> How to debug this? What is wrong with my code?
>
> Thanks a bunch!
>
--
View this message in context: http://www.nabble.com/Ant-filterset-doesnot-work-tf3327767.html#a9252698
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Ant filterset doesnot work
Posted by jake_ryan <sr...@yahoo.com>.
I came to know that I need to declare tokens as follows:
DbUser=@DbUser@
DbPassword=@DbPassword@
It worked fine now.
Keith Hatton wrote:
>
> A favourite that trips me up is that the destination files are newer
> than the source files, so no copy actually happens. Maybe you need to
> add overwrite="true" to the <copy>?
>
> Hope this helps,
> Keith
>
>
> -----Original Message-----
> From: jake_ryan [mailto:srinadh0@yahoo.com]
> Sent: 01 March 2007 16:14
> To: user@ant.apache.org
> Subject: Re: [SEC=UNCLASSIFIED] Ant filterset doesnot work
>
>
>
> Forgot to mention.. Here are the files:
> file-1:
> cc.db.username=itsme
> cc.db.password=itsme
>
> file-2
> DbUser=shared
> DbPassword=shared
>
> After running ant, still I see DbUser and DbPassword as shared/shared. I
> expected they wouldbe itsme/itsme.
>
> I tried to use begintoken="%" endtoken="*" aswell, but of no use.
>
>
> jake_ryan wrote:
>>
>> I have a property file-1 where cc.db.username and cc.db.password are
>> defined.
>>
>> There is property file-2 with tokens DbUser and DbPassword with some
>> default values, that will be copied to a directory.
>>
>> My task is to replace values of DbUser and DbPassword in file-2 with
>> values of cc.db.username and cc.db.password in file-1.
>>
>> I have a code like this:
>> <echo message="Copying SPP_CC config file to
>> ${jboss.local.conf.dir}"></echo>
>> <copy file="${cc.config.files.dir}/SPP_CC_Config.properties"
>>
>> tofile="${jboss.local.conf.dir}/SPP_CC_Config.properties"
> filtering="on">
>> <filterset>
>> <filter token="DbUser" value="${cc.db.username}"/>
>> <filter token="DbPassword" value="${cc.db.password}"/>
>> </filterset>
>> </copy>
>>
>> After running ant, I get successful message but still the copied file
>> contain old values. How to debug this? What is wrong with my code?
>>
>> Thanks a bunch!
>>
>
> --
> View this message in context:
> http://www.nabble.com/Ant-filterset-doesnot-work-tf3327767.html#a9252698
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Ant-filterset-doesnot-work-tf3327767.html#a9258812
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org