title: How do you force Gradle to overwrite a resource file in a custom WAR task?
body: <p>i create a war task to overwrite src/main/resources with src/release/resources:</p>
  
  <pre><code>task warRelease(type: War) {
      webInf {
          from 'src/release/resources'
          into 'classes'
      }
      duplicatesStrategy = DuplicatesStrategy.WARN
  }
  </code></pre>
  
  <p>unexpected there are two database.properties in the war file</p>
  
  <pre><code>$ jar tf build/libs/project.war | grep database
  WEB-INF/classes/database.properties
  WEB-INF/classes/database.properties
  </code></pre>
  
  <p>According to <a href="http://issues.gradle.org/browse/GRADLE-1264" rel="nofollow">this</a>,</p>
  
  <blockquote>
    <p>As of Gradle 0.9.1, the Copy task always overwrites files. The other
    strategies are not supported yet.</p>
  </blockquote>
  
  <p>gradle -v</p>
  
  <pre><code>Gradle 2.14.1
  ------------------------------------------------------------
  
  Build time:   2016-07-18 06:38:37 UTC
  Revision:     d9e2113d9fb05a5caabba61798bdb8dfdca83719
  
  Groovy:       2.4.4
  Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
  JVM:          1.8.0_102 (Oracle Corporation 25.102-b14)
  OS:           Linux 4.7.2-1-ARCH amd64
  </code></pre>