title: Spring: Injecting different properties file according to profile
body: <p>First, some context:</p>
  
  <p>I'm currently working on a project in which I use the Spring framework on Google's AppEngine (GAE) to fetch some data from one of Google's services. To do so, I make use of Google's OAuth facilities. For this, I need to use a <code>clientSecret</code> and <code>clientId</code> that are specific to my application. As these are static configuration values, I use Spring's <code>&lt;util:properties&gt;</code> (<a href="http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/xsd-config.html#xsd-config-body-schemas-util-properties" rel="noreferrer">link to documentation</a>) functionality to insert these values into the appropriate classes.</p>
  
  <p>XML config:</p>
  
  <pre><code>&lt;util:properties id="googleProperties" location="WEB-INF/google.properties" /&gt;
  </code></pre>
  
  <p>Class usage:</p>
  
  <pre><code>@Value("#{googleProperties['google.data.api.client.id']}")
  private String clientId;
  </code></pre>
  
  <p>My Question:</p>
  
  <p>As it turns out, the values of <code>clientId</code> and <code>clientSecret</code> need to be different for production (when deployed on App Engine) as for development (on my local machine). In order to solve this without constantly needing to change the values in the properties file when deploying, I have been looking into Spring's configuration <code>profiles</code> that would allow me to specify different property files for production and for development. Although I have an idea how Spring profiles work based <a href="http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/" rel="noreferrer">on the documentation</a>, I am not at all sure what the appropriate solution would be in this particular situation.</p>
  
  <p>In other words, how can I inject different property files based on whether my application is deployed locally or on GAE?</p>