Try it like this, create different directories in the root of the classpath, containing the configuration of the different environments. Keep the same file names:
.
|____pom.xml
|____src
| |____main
| | |____resources
| | | |____dev
| | | | |____application.properties
| | | |____test
| | | | |____application.properties
| | | |____prod
| | | | |____application.properties
Then at application startup, pass in an environment variable that says which environment to use. For example:
-Denv=prod
configure the loading of a given properties file depending on the environment variable using util:properties like this:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<util:properties id="application" location="classpath:${env}/application.properties"/>
... remaining config here
</beans>