This is a brief note about ${…} placeholder resolution in Spring.
Tested with Spring 4.0 ~ 4.2.

The simplest way I’ve found is to define a bean of PropertySourcesPlaceholderConfigurer class: this bean will resolve placeholder using every PropertySource that takes part to Spring’s Environment (for example, JVM system properties, system environment variables, or custom ones like an external file).

The bean definition could be the following, with the “static” modifier to allow early bean instantiation.

public class GeneralConfiguration {
  public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
    return new PropertySourcesPlaceholderConfigurer();