In my spring boot 2.7.5 project I am using gradle 7.5.1. As now I have to explicitly specify the DuplicatesStrategy for copySpec, I am trying like the following
Without this I am getting error Entry application-dev.properties is a duplicate but no duplicate handling strategy has been set.
So INCLUDE works fine but whenever I am using DuplicatesStrategy.INHERIT I am again getting the same error Entry application-dev.properties is a duplicate but no duplicate handling strategy has been set.. Why is this happening?
Well, if you try to inherit the duplicates strategy from the parent copy spec, but there either is not parent copy spec or the parent copy spec has no explicit duplicates strategy set, you inhert the fact that there is no explicit duplicates strategy set and thus you have the same problem and thus get the same error.
Btw. you should not use .all { ... }, as it works against task-configuration avoidance, but .configureEach { ... } instead, and you should consider not using allprojects { ... } (or subprojects { ... }) as that introduces project coupling which is bad practice and works against more advanced Gradle features. You should instead use convention plugins for common build logic.