title: Use property from command line for resources filtering
body: <p>I am using maven and want to write some maven properties to a properties file by using resource filtering.<br />
  This seems to work fine unless I try to overwrite certain properties from the command line.</p>
  <p>For instance in the example below I set the property <code>application-type</code> to MIXED in the pom.xml but I want to overwrite it with BATCH from the command line. The filtering still writes MIXED to my properties file even though I provide the property like this: <code>-Dapplication-type=BATCH</code></p>
  <p>How can I write the property values which are provided via command line parameters to the properties file?</p>
  <p>Project structure:</p>
  <pre><code>.
  |-- pom.xml
  `-- src
      `-- main
          `-- resources
              `-- application.properties
  </code></pre>
  <p>pom.xml (irrelevant parts omitted):</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;properties&gt;
          &lt;!-- ApplicationType should be provided via maven parameter. Allowed values: MIXED, DIALOG, BATCH --&gt;
          &lt;application-type&gt;MIXED&lt;/application-type&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
          &lt;sourceDirectory&gt;src/main/java&lt;/sourceDirectory&gt;
          &lt;testSourceDirectory&gt;src/test/java&lt;/testSourceDirectory&gt;
          &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt;
  
          &lt;!-- Apply filtering to write maven properties into properties file --&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;src/main/resources&lt;/directory&gt;
                  &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
  
          &lt;!-- ... --&gt;        
  &lt;/build&gt;
  </code></pre>
  <p>application.properties:</p>
  <pre><code>application-type=${application-type}
  </code></pre>
  <p>and i am calling it like this:<br />
  <code>mvn clean process-resources -Dapplication-type=BATCH</code></p>
  <p>However the resulting application.properties (in target/classes/application.properties) contains:<br />
  <code>application-type=MIXED</code><br />
  instead of the expected<br />
  <code>application-type=BATCH</code></p>