title: Copy resources from a dependency jar or war file in Gradle
body: <p>We have multiple war files in different projects, say A and B, sharing common resources like images. The common resources are placed in a war module in a separate project E. And this war file is added as dependency in all the war modules in projects A and B. Currently we are using maven resource plugins to copy these common resources to the root of A and B modules. </p>
  
  <p>How can we do the same action using Gradle?
  I am trying this with below configuration, but the files are not copied in to the generated war file. They are only copied to build/libs folder.</p>
  
  <pre>
      configurations {
          commonWebResources
      }
      task extractApi(type: Copy) {
          print 'File : ' + configurations.commonWebResources.singleFile
          from zipTree(configurations.commonWebResources.singleFile)
         into file("${project.buildDir}/libs/")
      }
  
      compileJava.dependsOn(extractApi)
  
  </pre>