mercredi 25 février 2015

Spring Configuration xml and properties out of war

My goal is to make SpringApplicationContext.xml and all environment specific properties file out of war file, so that the war file is environment independent.


1. Externalize properties file: I think I need to do something like this..



<property name="searchSystemEnvironment" value="true" />
<property name="locations">
<list>
<value>http://file/${MY_ENV_VAR_PATH}/my.app.config.properties</value>
</list>
</property>


Also discussed here, how to read System environment variable in Spring applicationContext


2. Externalize SpringApplicationContext.xml: I may use Spring boots feature of Externalized Configuration.


http://ift.tt/XZt1Q6


Q1: Being new to Spring boot, I am not sure if I can safely delete/unselect all the unnecessary features that come with Spring boot and apply those to my project? I see Spring boot is for project which are getting started from scratch, in my case I am working on a mature project.


Q2: Is Externalizing configuration an antipattern and am I going in the right direction with my above approach?


Aucun commentaire:

Enregistrer un commentaire