title: Maven 3 different profiles - Spring propertyPlaceHolderConfig cannot use value from pom file
body: <p>I'm having some problems with maven 3 and getting to load the right .properties file.</p>
  
  <p>What I want to achieve is the following: With mvn -Plocal i want to load the setting-local.properties, and if its run with prod i want to load the settings-prod.properties.</p>
  
  <p>It works by using mvn -Denv=local, but when I try with the -Plocal the variable are not loaded (settings-${env}.properties does not exist).</p>
  
  <p>My pom.xml:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;local&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;env&gt;local&lt;/env&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>In my applicationcontext I have want to load the env-variable:</p>
  
  <pre><code>&lt;bean id="propertyPlaceholderConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="locations"&gt;
                  &lt;list&gt;
                          &lt;value&gt;classpath:settings-${env}.properties
                          &lt;/value&gt;
                  &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="ignoreUnresolvablePlaceholders"&gt;
                  &lt;value&gt;true&lt;/value&gt;
          &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>So whats the problem, should'nt it work both ways?</p>