In your case, you can better set the system property for the location of the properties file
System.getProperties().setProperty("location", args[0]);
Then in applicationContext.xml
<context:property-placeholder location="${location}" ignore-unresolvable="true"/>
Hope this solves your problem.
source
share