title: Spring MVC | Load Environment specific Property Files
body: <p>I'm working a Spring MVC project (version > 4.x). This is not a Spring Boot project.
  I need to have a mechanism where I can maintain environment specific folders such as 'DEV', 'PROD', 'UAT" etc. Each one of these folders will have properties specific to that specific environment.
  I have configured my PropertiesPlaceholder as under:</p>
  
  <pre><code>&lt;context:property-placeholder
          location="classpath:application-default.properties, classpath:application-${env}.properties"
          ignore-unresolvable="true" /&gt;   
  </code></pre>
  
  <p>My properties are defined as under:</p>
  
  <pre><code>-src
   -main
    -Resources
     -Properties
      -application-dev.properties
      -application-prod.properties
  </code></pre>
  
  <p>I want the placeholder ${env} to get resolved at runtime so that only the properties relevant to that environment should be read by the propertyplaceholder.</p>
  
  <p>I would love to hear your comments and the best practices around it. In higher environments, we will have a Jenkins pipeline doing th ebuilds for us. </p>