Richard, Thanks for the suggestion. I appreciate the elegance of your ant targets to create war files targeted for each runtime environment.
The reason that I am looking for a different approach is this approach would require me to create a new war file if the managers of the runtime environment want to reconfigure. I'm trying to find ways that I can put more configuration information outside of the war file, perhaps in the context.xml or in some file that context.xml references. Paul -----Original Message----- From: Richard Mixon [mailto:[EMAIL PROTECTED] Sent: Saturday, June 24, 2006 9:44 PM To: 'Tomcat Users List' Subject: [SPAM] RE: Best Practice for properties files Paul, are you using the deployer application to deploy your app (e.g. apache-tomcat-5.5.17-deployer)? If so, then it is very easy to modify the build.xml to customize the log4j.properties, app.properties 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" depends="clean,customizeContext"> ... <!--- 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 META-INF/${webapp}.xml"> <!-- Customizing ${webapp.path}/META-INF/${webapp}.xml --> <echo level="info">Customizing ${webapp.path}/META-INF/${webapp}.xml</echo> <move tofile="${webapp}/META-INF/context.xml_bak" file="${webapp}/META-INF/context.xml" overwrite="false" failonerror="false"/> <delete file="${webapp}/META-INF/context.xml" failonerror="false"/> <echo level="info">Changing hibernate.connection.driver_class to ${jdbc.connection.driver_class}</echo> <copy tofile="${webapp}/META-INF/context.xml" file="${webapp}/META-INF/context.xml_bak" overwrite="true" failonerror="true" verbose="true"> <filterset> <filter token="webapp.name" value="${webapp.name}"/> <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}"/> </filterset> </copy> ... </target> -----Original Message----- From: Paul Mendelson [mailto:[EMAIL PROTECTED] 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 server. My application uses log4j for its internal logging and I have a log4j.properties file that I keep in web/WEB-INF/classes. I also have a regular app.properties file that I keep in web/WEB-INF. I deploy my application to my tomcat server by placing app.war in the proper directory. My question is if I am running my application on 4 or 5 different tomcat servers and toe log4j.properties and app.properties 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 me. Any advice is appreciated. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]