Copy single file

I believe the solution is the same as in the other thread. Replace copy with either into or from. The rename call should also work with into and from.

The explanation is more detailed in the link, but in summary the copy used doesn’t copy into the War, but actually copies a file to src/main/resources when the task is created (not executed). This means that if you have more than one task copying to the same destination, the last task created will overwrite the file copied by the previous task(s).

The solution is to use the CopyTask's helper methods to define what should be copied into the archive. You can use into to specify the destination path inside the archive, or use from and add it to the root of the archive.

Hope this helps :slight_smile:

1 Like