The build is very simple and contains just one Copy task (named “abc”). It should copy the files from “$buildDir/from” into “$buildDir/dest” which are also prepared in the package. As long was the WAR plugin is commented out (which it is not in the package) everything works as expected. But as soon as the WAR plugin is active the “from” directory seems to just replace the “dest” directory.
I consider this a bug but I can’t create a thread in the Bugs forum.
Please note:
The error just seems to happen as long as the .gradle directory doesn’t exist. Therefore it is easier to just use the abc.tar.gz every time you want to try it without reusing existing unpacked files.
Thanks for your reply but I don’t want to use the war task. I also don’t want to build a war by that task. The problem is that the Copy task doesn’t work correctly anymore as soon as the war plugin is added to the project.
Did you try my example? The abc task behaves differently as soon as the war plugin is loaded. From my perspective this is a bug. This example is reduced to the very minimum. The real build is much larger and much more complex but it boils down to the war plugin corrupting the Copy task.