title: Load different properties for development and deployment
body: <p>I have a very common use case -- connect to different databases when my program is in development mode, in test mode, or in deployment mode.</p>
  
  <p>The way I am doing it now, is I configure a data source, and pass it ${...} properties via bean:property tag.</p>
  
  <p>However to get the ${...}, i am doing </p>
  
  <pre><code>&lt;context:property-placeholder properties-ref="myProperties" /&gt;
  </code></pre>
  
  <p>and in the bottom of the xml config, I have </p>
  
  <pre><code>&lt;beans profile=test&gt;
     &lt;util:properties id=myProperties&gt;
     &lt;/util&gt;
  &lt;/beans&gt;
  &lt;beans profile=dev,default&gt;
     &lt;util:properties id=myProperties&gt;
  &lt;/beans&gt;
  &lt;beans profile=prod&gt;
    &lt;util:properties id="myProperties&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>This seems inefficient, overly verbose, and prone to error. All spring properties tutorials tell me that context:property-placeholder is Environment aware, and Environment is responsible for profiles so how do I simplify this? It is intuitive to me that there is a simpler way, I just can't figure it out.</p>
  
  <p>Really, what I am looking for is to specify profile on context:properties-placeholder, or something like that.</p>