This seems like a pretty common problem, but I haven\'t found any sort of consensus on the best method, so I\'m posing the question here.
I\'m working on a command-l
You could use
in your Spring XML and configure ${target_env}
using a command-line argument (-Dtarget_env=test.
).
Starting in Spring 3.1 you could use
and specify a default value, thereby eliminating the need to set the value on the command-line.
In case Maven IS an option, the Spring variable could be set during plugin execution, e.g. during test or integration test execution.
org.apache.maven.plugins
maven-surefire-plugin
2.12
test.
I assume different Maven profiles would also work.