>There's a lot of power in what the <replace> task can do.
>Here's a very
>simple one that replaces the string "@port@" with the port number
>specified by the "port" property:
>
> <project name="Create server.xml" default="generate">
>
> <target name="generate" description="Generate customized
>server.xml">
> <replace file="server.xml" token="@port@" value="${port}"
> </target>
>
> </project>
>
>In your template server.xml, you'd have a <Connector> element
>like this:
>
> <Connector ... port="@port@" .../>
>
>Now, you just run "ant -Dport=8085" and you've replaced the
>port number.
>Generalizing this to replace lots of properties is straightforward.
Thanks Craig it's a very good example of Ant Power, I will certainly
reuse it for others purposes.
But it won't fit my current need since in my project I have to launch
not less than 20 differents Tomcat instance on the same machine !
TC 3.3 property overriding is more easy to use in such situation and
should be a very usefull feature for TC 4.x.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>