I’m trying to understand the reasoning behind why Spring Roo places database.properties in META-INF/spring, where it will be deployed as part of the WAR.
Surely database properties are environment specific and should be outside a WAR where they can be changed without rebuilding? I’m about to change the line in application-context.xml to search for properties files anywhere on the classpath and move the file to where it won’t be packaged with the WAR.
Is there something I’m not getting here that will make me regret this?
I have handled this using Spring’s PropertyPlaceholderConfigurer and including property files on the classpath and one on the filesystem:
If there is a myapp*.properties file in the current directory when the app starts (or tests are run etc.) it will override properties from files baked into the war/ear/whatever. You could take out the star but then you will have to have the file present.