There are a number of solutions for this.
1) Using
Maven, you can create a directory in the src/main/resources directory for each environment/variation in which each directory has the same named config file. Them using Maven profile's when you build it will copy the corresponding config files from the corresponding directory for that profile. Maven automatically copies files from the resources directory into your classpath of your archive.
2) Use the new Spring 3.x Expression Language to dyamically figure out what environment you are in and import the correct file. You will need to read the SPel documentation.
3) In the upcoming Spring 3.1 they are introducing Profiles in your Spring config file. Basically the implementation will be <beans> tags inside <beans> tag where the inner <beans> tag will have an attribute "profile" So you could do something like
This new approach is similar to what is already in Grails config files, and is extremely cool.
4) Use the PropertyPlaceholderConfigurer and in your <import resource="${config.fileName}" then in a Properties file, or a System environment variable on that machine set the config.fileName property to the filename you want imported in that environment. (This same type of approach can be used with Spring Expression Language with "#{systemEnvironment.config_fileName}" which would look for an OS environment variable called config_fileName
5) You can do it the long laborous way and change your xml config file just before you compile and create your archive. ;)
Mark>