title: Taking properties from Maven settings.xml file to application context
body: <p>There are nice SO <a href="https://stackoverflow.com/questions/4107222/can-i-inject-properties-from-maven-passwords-defined-in-settings-xml-into-my-s">question and answers</a> about this issue, but these options didn't work for me.</p>
  
  <p>I want to pass variables to app context:</p>
  
  <pre><code>&lt;bean class="blah.blah.Blah" id="blah"&gt;
      &lt;property name="first" value="${first.property}"/&gt;
      &lt;property name="second" value="${second.property}"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I have the following in the Maven's <code>settings.xml</code> file:</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
        &lt;id&gt;profileId&lt;/id&gt;
        &lt;activation&gt;
            &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
        &lt;/activation&gt;
        &lt;properties&gt;
            &lt;first.property&gt;first value&lt;/first.property&gt;
            &lt;second.property&gt;second value&lt;/second.property&gt;
        &lt;/properties&gt;
  </code></pre>
  
  <p>I tried <a href="https://stackoverflow.com/a/10736501/1240930">this option</a> (which is a bit strange), it gave no results. Than I added this plugin:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
      &lt;artifactId&gt;properties-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;1.0-alpha-2&lt;/version&gt;
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;phase&gt;process-resources&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;write-project-properties&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;outputFile&gt;
              src/main/resources/maven.properties
            &lt;/outputFile&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt; 
  </code></pre>
  
  <p>And there wasn't any <code>maven.properties</code> files in the project afterwards. If I created empty file, nothing appeared in it. And I tried to do repeat these steps with <code>-PprofileId</code>, it didn't help. Could someone please provide a working code snippet or tell me what do I miss here? Thanks in advance.</p>
  
  <p><strong>Update</strong>: I was wrong, <code>properties-maven-plugin</code> works fine.</p>