title: How to stop Maven from overwriting resource files
body: <p>I have the default maven structure: </p>
  
  <pre><code>main
  --java
  --resources
  --webapp
  </code></pre>
  
  <p>I see that every <code>mvn compile</code> copies resources even though they were not changed.
  What should I do to make build copy only changed files?</p>
  
  <pre><code>&lt;build&gt;
           &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
      &lt;/build&gt;
      &lt;dependencies&gt;
          ...
      &lt;/dependencies&gt;
  
      &lt;properties&gt;
          &lt;maven.resources.overwrite&gt;false&lt;/maven.resources.overwrite&gt;
      &lt;/properties&gt;
  </code></pre>
  
  <p>Here is the output in debug mode:</p>
  
  <pre><code>[INFO] Using 'cp1252' encoding to copy filtered resources.
  [DEBUG] resource with targetPath null
  directory C:\core\src\main\resources
  excludes []
  includes []
  [DEBUG] ignoreDelta true
  [INFO] Copying 190 resources
  [DEBUG] file batch.bat has a filtered file extension
  [DEBUG] copy C:\core\src\main\resources\batch.bat to C:\core\target\classes\batch.bat
  [DEBUG] file DataObject.hbm.xml has a filtered file extension
  [DEBUG] copy C:\core\src\main\resources\com\data\DataObject.hbm.xml to C:\core\target\classes\com\data\DataObject.hbm.xml
  </code></pre>