Using Gradle 2.6, the following task is marked as UP-TO-DATE. The env variable is defined, the destination directory exists but it DOES NOT have any of the files in the list. When I run this task, it claims it is UP-TO-DATE. This does not seem like correct behavior to me.
task installDeps(type: Copy) {
onlyIf { System.env.KARAF_HOME }
into "$System.env.KARAF_HOME/deploy"
from configurations.runtime.files
}