tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject RE: Tomcat 3.3 and 4.x tuning via command line
Date Fri, 08 Feb 2002 18:03:41 GMT

On Fri, 8 Feb 2002, GOMEZ Henri wrote:

> Date: Fri, 8 Feb 2002 18:10:57 +0100
> From: GOMEZ Henri <>
> Reply-To: Tomcat Developers List <>
> To: Tomcat Developers List <>
> Subject: RE: Tomcat 3.3 and 4.x tuning via command line
> >I'm wondering whether we really need to build it in to Tomcat itself,
> >though.  Can't you accomplish the same thing by using a little
> >Ant script
> >and run a <filter> or <replace> task?  All this would require
> >is packaging
> >ant.jar along with Tomcat, or requiring users that need the facility to
> >download Ant themselves.
> Could you give us a little example of ant replace task ?
> It will be a great interest for the mass :)

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}"


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.

See the Ant docs for more details <>.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message