tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Mixon" <>
Subject RE: Best Practice for properties files
Date Sun, 25 Jun 2006 01:44:24 GMT
Paul, are you using the deployer application to deploy your app (e.g.

If so, then it is very easy to modify the build.xml to customize the, and any other file, and then deploy it
properly. You could even have a different ant target for each different
instance of the webapp.war file.

Here's an example of the build.xml that we setup. In this case most of the
example deals with setting the JDBC connection to the correct database.

HTH - Richard

  <!-- ===================================================================
  <!-- Deploy for development (basically customize and copy to webapps dir
  <!-- ===================================================================
  <target name="devDeploy" description="Development Deploy"

  ... <!--- note we added the "customizeContext" target in the above depends

  <!-- The target below can have anything you wish in it -->
  <!-- ===================================================================
  <!-- Customize context for web application
  <!-- ===================================================================
  <target name="customizeContext"
      description="Customizes web application context if its stored in
      <!-- Customizing ${webapp.path}/META-INF/${webapp}.xml -->
      <echo level="info">Customizing
      <move tofile="${webapp}/META-INF/context.xml_bak"
         overwrite="false" failonerror="false"/>
      <delete file="${webapp}/META-INF/context.xml" failonerror="false"/>
      <echo level="info">Changing hibernate.connection.driver_class to
      <copy tofile="${webapp}/META-INF/context.xml"
              overwrite="true" failonerror="true" verbose="true">
                <filter token="" value="${}"/>
                <filter token="docbase.dir" value="${docbase.dir}"/>
                <filter token="workdir.dir" value="${workdir.dir}"/>
                <filter token="database.url" value="${database.url}"/>
                <filter token="app.username" value="${app.username}"/>
                <filter token="app.password" value="${app.password}"/>

-----Original Message-----
From: Paul Mendelson [] 
Sent: Friday, June 23, 2006 9:46 AM
To: Tomcat Users List
Subject: Best Practice for properties files

I have a fairly normal application that I am deploying on a tomcat 5.5

My application uses log4j for its internal logging and I have a file that I keep in web/WEB-INF/classes.  I also have a
regular file that I keep in web/WEB-INF.

I deploy my application to my tomcat server by placing app.war in the proper

My question is if I am running my application on 4 or 5 different tomcat
servers and toe and file needs to be set up
different on each server what is the best way to deploy and maintain those
files?  I very much want to create a single app.war file and let each system
administrator customer there properties without needing to synchronize with

Any advice is appreciated.

To start a new topic, e-mail: To unsubscribe,
For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message