title: Gradle extract multiple dependencies each to a different directory
body: <p>I'm trying to extract multiple dependencies into different directories. I tried the following.</p>
  
  <pre><code>configurations {
     cppDependencies
  }
  
  dependencies {
     cppDependencies 'com.group:artifact1:1.0"
     cppDependencies 'com.group:artifact2:1.0"
  }
  
  task extractDeps(type: Copy) {
      from {
          configurations.cppDependencies.collect {
              zipTree(it)
          }
      }
      into new File(buildDir, "DEP_DIR")
  }
  </code></pre>
  
  <p>Obviously this just extracts <strong>artifact1</strong> and <strong>artifact2</strong> under the same <strong>DEP_DIR</strong> directory. But what I would actually want to achieve is extract them under <strong>DEP_DIR/artifact1</strong> and <strong>DEP_DIR/artifact2</strong> respectively.</p>
  
  <p>I tried to put <strong>into new File(buildDir, "DEP_DIR/" + it.artifactId)</strong> under the <strong>zipTree</strong> command but it gives an error.</p>
  
  <p>Is this possible?</p>