ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain ROY <armaill...@free.com>
Subject Re: inline property expansion not working as advertised
Date Tue, 15 Jan 2008 10:00:51 GMT

Adding <property file="test.properties"/>, the expansion occurs.

<?xml version="1.0"?>
<project name="inline props test" default="test">
   <property file="test.properties"/>
   <target name="test">
      <echo>deploy.url is ${deploy.url}</echo>
   </target>
</project>

It seems not to occur when the property file is given in the command line.

Regards
Alain ROY



On Thu, 10 Jan 2008 14:52:27 -0800 (PST)
Michael Pelz Sherman <mpelzsherman@yahoo.com> wrote:

> From the Property task docs (http://ant.apache.org/manual/CoreTasks/property.html) 
> 
> ================================
> In-file property expansion is very cool. Learn to use it. 
>  Example: 
> 
> build.compiler=jikes
> deploy.server=lucky
> deploy.port=8080
> deploy.url=http://${deploy.server}:${deploy.port}/
> ================================
> 
> So I created a properties file with the above 
> and the following build.xml file:
> 
> ==================================
> <?xml version="1.0"?>
> <project name="inline props test" default="test">
>         <target name="test">
>             <echo>deploy.url is ${deploy.url}</echo>
>         </target>
> </project>
> ==================================
> 
> The I ran it as follows:
> 
> $ ant -propertyfile test.properties
> 
> Here is the output:
> 
> ==================================
> Buildfile: build.xml
> 
> test:
>      [echo] deploy.url is http://${deploy.server}:${deploy.port}/
> 
> BUILD SUCCESSFUL
> Total time: 0 seconds
> ================================== 
> I'm using ant 7.0.
> 
> What am I doing wrong?
> 
> Thanks,
> - mps
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message