i work in a very constrained environment where our
CM has mandated that we need to build once with the
ability to deploy the ear file to any of our environments
(4 in total). to address this mandate we have come
up with a solution that includes a specialized property
file format and a system (-D) level property that
specifies the runtime env. here's an example that
demonstrates what i'm talking about. this is the
properties file format where we use a special '[ ... ]' in
front of the property.
property file:
[test] jdbc.password=lasdj(*==
[prod] jdbc.password=jfdsa(*==
[all] app.name=appName
.... etc
and we set a system property to map to the correct
environment when we start the server:
java -Denv=test
so based on this simple naming convention we can
resolve the correct property value for a given
environment but this requires some special handling
and this is where i'm having difficulty. i have a
special env aware propertyreader that i need to use
as the source for the properties.
long story short, i want to be able to use the
placeholder mechanism but i need the properties to
be fetched using my special propertyreader. i would
appreciate any recommendations that would help me
to solve this problem.


Reply With Quote