How to turn off dependency management for single task

I am trying to do configure-make-make install C++ build using gradle. For that, I need to create a Copy task, which copies a template configuration file into project root directory, which expanding values in it. I actually managed to that except for one detail - it refuses to put that file into project root with the following error message:

Failed to capture snapshot of output files for task 'configure' during up-to-date check.

Stack trace:

org.gradle.api.UncheckedIOException: Failed to capture snapshot of output files for task 'configure' during up-to-date check.  See stacktrace for details.
Caused by: org.gradle.api.UncheckedIOException: Failed to create MD5 hash for file <project-root>\tools\gradle\.gradle\2.6\taskArtifacts\
Caused by: The process cannot access the file because another process has locked a portion of the file
        at org.gradle.internal.hash.HashUtil.createHash(
        at org.gradle.internal.hash.HashUtil.createHash(
        ... 118 more

If I try to put it anywhere else, it works fine, but since this is kind of bootstrap, I do not even know where my build directory will be, so I can not put it there and therefore project root is the only viable destination location.

Now, since this task has to be run always, regardless of whether is has already been built or not, I do not need any dependency management for it. Hence the question: Is there any way how to turn off dependency management for this task? This should resolve any problem for capturing snapshot, since any snapshot should not be generated in the first place.

Note: I tried the obvious outputs.upToDateWhen { false }, but for some reason, it still tries to create snapshot and fails with the very same error.

Edit: While adding additional stack trace output, I just realized that I am lying a bit in the above text: I am using GradleBuild task to run separate project located in <project-root>/tools/gradle/ and the destination directory for Copy task is <project-root>, i.e. two levels above the “current project root” from configure-subproject’s perspective.