What are common strategies for defining a bunch of beans, which are used differently in development and production environments?
Let\'s say I have 2 beans, each impl
Here goes what Spring reference documentation says about PropertyPlaceholderConfigurer
The PropertyPlaceholderConfigurer does not look for properties only in the Properties file you specify, but also checks against the Java System properties if it cannot find a property you are trying to use.
As you can see above you can set up a Java System property
On The development machine
-Dprofile=development
On The production machine
-Dprofile=production
So you can define a global application context settings which import each layered context settings as follows
Keep in mind all location paths are relative to the definition file doing the importing
Therefore, This kind of configuration is supported by Spring
It is generally preferable to keep an indirection for such absolute locations, for example, through "${...}" placeholders That are resolved against JVM system properties at runtime.