I define passwords to servers via properties I define in my ~/.m2/settings.xml (could be anywhere, though, including pom.xml) for my deployment plugin. I\'d like to use the
Sure. Maven resource filtering is the way to go.
Here's a sample configuration (files matching *-context.xml will be filtered, others won't):
src/main/resources
true
**/*-context.xml
src/main/resources
false
**/*-context.xml
A different approach would be to use the Properties Maven Plugin to write all project properties to a file and reference that file from Spring using the PropertyPlaceholderConfigurer mechanism.
Maven Configuration:
org.codehaus.mojo
properties-maven-plugin
1.0-alpha-2
generate-test-resources
write-project-properties
${project.build.testOutputDirectory}/mavenproject.properties
Spring configuration: