With Gradle 7 now my copy resources task fails.
It complains about duplicate files.
I solved it by adding duplicatesStrategy = 'include' to my Copy task, after checking the Gradle 7 Release Note where this change is mentioned.
However I find it strange though, since the files it complains about has no duplicates.
> Entry application-viewer.desktop is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.0/dsl/org.gradle.api.file.CopySpec.html#org.gradle.api.file.CopySpec:duplicatesStrategy for details.
> Entry preuninstall is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.0/dsl/org.gradle.api.file.CopySpec.html#org.gradle.api.file.CopySpec:duplicatesStrategy for details.
These are files used by jpackage tool. This tool has template for these files, but they are not in my project.
but that hasn’t solved the issue, I am still getting the error:
Entry application.properties is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.0.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
Task :processE2eTestResources FAILED
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':processE2eTestResources'.
It doesn’t matter whether you defined it, a third-party plugin defined it, or something in the Gradle core defined it. Nothing stops you from configuring an existing task regardless of where it was defined. Once it’s defined, you can reference it directly, or use tasks.named(...) if you’re making use of the configuration avoidance APIs.