1
I have an app web (war)
legacy where various environment settings are arranged in XML files, e.g.: the BD path is in the context.xml
<Context path="/Base" reloadable="true" crossContext="true">
<Resource name="jdbc/infodata" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" username="xxxx"
password="xxxx"driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost;instanceName=SQLEXPRESS;databaseName=db" />
</Context>
To generate the WAR
application according to customer’s environment use the Jenkins
with the Plugin for Ant
, configure a JOB
for each different environment.
And I use a script
of Ant
to load the configs
of each environment and write in all XML's
application configuration.
This involves context
, config
of log4j
and configs
of services of spring
.
The trouble with that is I get a lot of files war
equal only with variaveis
different environment, and the system versions are "zicadas". While cliente X
is in the version 56, cliente Y
is in the 2 but are identical, for example.
Is there any way other than "Gambi" that I can at runtime read an external configuration file to war
and configure the context.xml
, log4j.xml
and spring-services.xml
or improve this process in any way?
Related question: http://answall.com/q/45978/227
– utluiz