I\'ve got a Maven settings.xml file in my ~/.m2 directory; it looks like this:
I recommend you to use a property file in the middle. I mean: Spring application would load properties values form the property file using context:property-placeholder and Maven would be the one who replace ${...} variables using values from settings.xml using filtering.
Your property file:
db.driver=${db.driver}
db.url=${db.url}
username=${username}
password=${password}
Your servlet-context.xml file
${db.driver}
${db.url}
${username}
${password}
In your pom.xml
...
src/main/resources
true
...