title: Spring add placeholder value at runtime
body: <p>Suppose having the following Spring configuration where <code>genericDirectory</code> placeholder is unknown at compile time:</p>
  
  <pre><code>@Configuration
  @PropertySource("${genericDirectory}/additional.properties")
  public class SomeConfiguration{
    //...
  }
  </code></pre>
  
  <p>I tried to add a property before refreshing context, but still get exception</p>
  
  <pre><code>public static BeanFactory createContext(String genericDirectoryName) {
     AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
  
     PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
  
     Properties props = new Properties();
     props.setProperty("genericDirectory", genericDirectoryName);
  
     configurer.setProperties(props);
  
     applicationContext.addBeanFactoryPostProcessor(configurer);
  
     applicationContext.register(SomeConfiguration.class);
  
     applicationContext.refresh(); // throws IllegalArgumentException: Could not resolve placeholder 'genericDirectory' 
  
     return applicationContext;
  }
  </code></pre>
  
  <p>I also tried to set the property in parent context and pass it to child via <code>setParent</code> method, but didn't succeed (got the same exception).</p>
  
  <p>Please, show how to add a property to ApplicationContext in runtime.</p>
  
  <p>PS. there's no hidden configuration in this case - context is created manually as is.</p>