I have a legacy web (war)
application where various environment settings are arranged in XML files, eg the DB path is in 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 WAR
of the application according to the client environment I use Jenkins
with the Ant
Plugin, I set 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
of application configuration.
This involves context
, config
of log4j
and configs
of services spring
.
The problems with this are that I get countless war
files equal, only with%% of environment% different, and the system versions are "zicadas". While variaveis
is in version 56 , cliente X
is in 2 but are identical, for example.
Is there any way other than "gambi" that I can at runtime read a configuration file external to cliente Y
and do the configuration of war
, context.xml
and log4j.xml
or improve this process some way?