> From: Adrian Beech [mailto:[EMAIL PROTECTED]
> 
> G'day,
> 
> I was wondering if it is possible to include the value of properties
> defined in the build.xml file in source files such as web.xml?  I have
> three staging environments which have platform specific attributes such
> as JDBC connections strings, application headers, etc.  These values are
> defined in the web.xml file and it would make life a whole lot easier if
> they could be defined as properties in the build.xml file and
> substituted in the right places within the source files when the
> appropriate target is specified.
> 
> One of the annoying things I need to do each time I progress an
> application from one environment to another is to remember to edit the
> web.xml file so that the resulting package has the appropriate
> application/environment attributes.  Things would be a hole lot nicer if
> I could simply type "ant dev", "ant test" or "ant prod" and have
> everything set up accordingly.
> 
> I would appreciate any help in this matter.

Two distinct approaches:

(1) Use Ant-like properties in the web.xml files (of the form ${name}),
    and use the <replaceproperties> Filter. Your web.xml files thus act
    as templates, and your <copy> (+filter) the actual files to use at
    runtime.

(2) Extract the values from the web.xml files, and use them in Ant.
    This is IMHO more difficult/cumbersome. You might get be able to
    to use <xmlproperty>, the JXPATH-based custom Property Helper
    defined somewhere by Nicola Ken Barrozi, or finally XSL your
    web.xml files into a property file your load, or a build file
    you import in the main build file.

I'd go with (1) myself, but I don't know of your specifics. --DD

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

Reply via email to