I believe what you're actually looking for is a way for Spring to manage different configuration profiles.
Unfortunately, at the time of this writing, such a feature does not exist. As far as I know, people usually devise various schemes to get around that, but essentially use Spring's PropertyPlaceholderConfigurer
to "inject" different runtime configurations into their property files by placing ${placeholder}
into their Spring import statements and then dereferencing this placeholder as their enviroment changes (e.g. "DEV", "TEST", "PROD").
That will be changed by Spring 3.1, though - as it will introduce @Profile
annotation which seems well coupled with Spring Java Configuration option, giving one a way to completely abandon XML configuration (should one choose to, of course).
Perhaps this article will shed more light into this: Spring 3.1 M1: Introducing @Profile