@Bean public static PropertyPlaceholderConfigurer propertyConfigurer() throws IOException { PropertyPlaceholderConfigurer props = new PropertyPlaceholderConfigurer(); props.setLocations(new Resource[] {new ClassPathResource("environment.properties")}); props.setSearchSystemEnvironment(true); props.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE); return props; }