Variable Scope for nested copySpec inside of an each loop

Is this behavior correct?

The code below works but without explicitly specifying the variable (jars), the nested into is applied to the copy task instance instead of the copySpec instance above it (into(‘jars’)) and the files are copied to temporaryDir instead of the directory under that. This happens with gradle 1.12 and 2.2.

repositories {
    mavenCentral()
}
  configurations {
    jars
 }
  dependencies {
    jars 'junit:junit:4.11'
}
  task copyJars(type: Copy) {
    into ('jars') { jars ->
        configurations.jars.each { jarFile ->
            jars.into (jarFile.name - '.jar') {
                from(zipTree(jarFile))
             }
         }
    }
    into temporaryDir
}

How names get resolved inside ‘configurations.jars.each { … }’ is no longer controlled by Gradle, but by Groovy’s ‘each’ method. ‘for (jarFile in configurations.jars) { … }’ might not have this problem.