I managed to extract it using this:
task test << { copy { from tarTree(resources.gzip('model.tar.gz')) into getProjectDir() } }
My only assumption is that either the dir file or the tgz file, or both are locked during the configuration phase and released during the execution phase.
If someone has a solution using the copy task, and not the copy method, I would appreciate it.
source share