Copy task extremely slow

@Sean I may have misunderstood your question. Try to make ‘exclude’ a top-level statement, rather than putting it inside curly braces.

@Peter I tried to add exclude and/or upToDateWhen, but got stuck as usual:

task deploy(type: Copy) {
        exclude "**/upload/**"
        outputs.upToDateWhen { false }
        into "/dest/dir"
        with war
}
  SHELL > gradle -i deploy
...
:deploy (Thread[main,5,main]) started.
:deploy
Executing task ':deploy' (up-to-date check took 0.002 secs) due to:
  Task.upToDateWhen is false.
> Building > :deploy

task copyToRepo(type: Copy){

from “Welch.txt”

into “\\server1\repo”

outputs.upToDateWhen { false }

}

Similar issue to that of Sean Liang. It just hangs. But when I check the folder. It actually copies it. But if I take off the line “outputs.upToDateWhen { false }”, it just hangs and not copy to the folder at all. So putting “outputs.upToDateWhen { false }” wasn’t much of a help.

13:19:57.284 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ‘:copyToRepo’ (up-to-date check took 0.045 secs) due to:

Task.upToDateWhen is false. 13:19:57.294 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ‘:copyToRepo’. 13:19:57.358 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache outputFileStates.bin (D:\tt.gradle\1.12\taskArtifacts\outputFileStates.bin) > Building 0% > :copyToRepo