Use the tools supplied - ant in this case

If you put an entry in your deploy target like this

<filter filtersfile="${env.DEPLOY_FILTER}"/>
        
<copy todir="${dest}/conf" overwrite="on" filtering="true">
<fileset dir="${dir}/conf">
        <exclude name="CVS"/>
</fileset>
</copy>


( you will have to monkey around with your own targets in build.xml,
there is alot of different ways to do this, this is just a simple
example )

where DEPLOY_FILTER is an environment variable indicating a path to a
java style properties file
that has entries like this:

PROP1=val1
PROP2=val2

then in your TR.props you can do this

database.default.driver=@PROP1@
database.default.url=@PROP2@ 

Just change the DEPLOY_FILTER environment variable when you build the
war file and voila!

Works great for me, I deploy to 4 different environments on many
different OS no problem. I have the filter files checked in to cvs so i
can deploy to any environment i have on demand with zero effort.

chris c

-----Original Message-----
From: Scott Eade [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, March 17, 2002 2:54 AM
To: turbine-user
Subject: Overriding properties defined in TR.props


As my webapp moves from development to staging and production I have to
edit
TR.props to alter the values to meet the requirements of the particular
environment.  In particular I have to adjust the database settings and
the
various parameters that tune a site for production.

At the bottom of the default tdk 2.1 TR.props there is a line that
includes
another properties file, flux.properties.  This looks like a good way
for me
to make the necessary customisations to TR.props for each environment -
I
define myapp.properties to include just the properties that need to be
customised for each environment and include this in a standard TR.props.

The comment above the line where flux.properties is included cautions me
to
be careful as duplicate property name values will be replaced.  The
actual
behaviour that I experience however is that duplicate names are not
tolerated and I must comment the properties out in TR.props in order to
get
my webapp to execute without dieing a horrible death at startup.

This is no big problem, but I was wondering if anyone else had
experienced
the problem and if there is a fix.  <cardinal-sin-confession>I haven't
checked the mail archive or cvs.</cardinal-sin-confession>

I am curious as to how others deal with this issue - have you got a
better
solution that you would like to share?

Cheers,

Scott


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to