ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Using properties to customize config files
Date Tue, 30 Sep 2003 06:16:40 GMT
<copy file="web.xml.template" tofile="web.xml">
    <filterchain>
        <expandproperties/>
    </filterchain>
</copy>

Should do the job.


Jan



> -----Original Message-----
> From: Jörn Gebhardt [mailto:Joern.Gebhardt@ptv.de]
> Sent: Monday, September 29, 2003 5:32 PM
> To: Ant Users List
> Subject: AW: Using properties to customize config files
> 
> 
> This assumes that I know all the tokens I want to replace beforehand.
> However, I want to add new properties to my property file and 
> new tokens to
> my config files without changing the build.xml. I.e. I want to run
> 
> <filter token="prop-name" value="${prop-name}"/>
> 
> for all properties of my property file.
> 
> Joern
> 
> -----Ursprüngliche Nachricht-----
> Von: Mark Lybarger [mailto:Mark.Lybarger@CBC-Companies.com]
> Gesendet: Montag, 29. September 2003 17:28
> An: 'Ant Users List'
> Betreff: RE: Using properties to customize config files
> 
> 
> you config file would look like:
> 
>       <auth-method>@security.auth-method@</auth-method>
> 
> and your build.xml has the following.
>     <filter token="security.auth-method" 
> value="${security.auth-method}"/>
> 
> check out the manual for token filtering.
> 
> -----Original Message-----
> From: Jörn Gebhardt [mailto:Joern.Gebhardt@ptv.de]
> Sent: Monday, September 29, 2003 11:23 AM
> To: user@ant.apache.org
> Subject: Using properties to customize config files
> 
> 
> Hi,
> 
> can you use Ant to replace properties in other files?
> 
> I have a build property file that might look like this:
> 
> security.auth-method=BASIC
> security.domain=myDomain
> ...
> 
> Now I want to use these properties to customize config files. 
> E.g. if I have
> a config file template web.xml that has the following context
>   <web-app>
>     <login-config>
>       <auth-method>${security.auth-method}</auth-method>
>       <realm-name>${security.domain}</realm-name>
>     </login-config>
>     ...
>   </web-app>
> I want to replace ${security.auth-method} by "BASIC" and 
> ${security.domain}
> by "myDomain".
> Does anybody know how I can do that?
> 
> Thanks for your help in advance,
> Joern
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message