Unexpected "Duplicate path" warning in :processFuncTestResources task

After upgrade to Gradle 6.3 I started to see number of the following warning (for different paths):

> Task :processFuncTestResources
Copying or archiving duplicate paths with the default duplicates strategy has been deprecated.
This is scheduled to be removed in Gradle 7.0. Duplicate path: 
"testProjects/junit5simple/src/test/java/pitest/test/LibraryJUnit5Test.java".
Explicitly set the duplicates strategy to 'DuplicatesStrategy.INCLUDE' if you want to allow duplicate paths.
Consult the upgrading guide for further information: https://docs.gradle.org/6.3/userguide/upgrading_version_5.html#implicit_duplicate_strategy_for_copy_or_archive_tasks_has_been_deprecated
Copying or archiving duplicate paths with the default duplicates strategy has been deprecated.
This is scheduled to be removed in Gradle 7.0. Duplicate path: 
"testProjects/junit5simple/src/main/java/pitest/test/Library.java".
Explicitly set the duplicates strategy to 'DuplicatesStrategy.INCLUDE' if you want to allow duplicate paths.
Consult the upgrading guide for further information: https://docs.gradle.org/6.3/userguide/upgrading_version_5.html#implicit_duplicate_strategy_for_copy_or_archive_tasks_has_been_deprecated
...

I don’t use copy or zip tasks explicitly. I’m not sure why those files in funcTest resources are considered as duplicated.

My funcTest sourceDirs configuration (and some lines below):

The content on the resources dir with some sample projects:

How to avoid those warnings?

Should I report a bug on it?

Sorry for the topic revival, but I had encountered exactly the same issue today and I’ll post the fix for other people who might run into it as well.

By default SourceSets are preconfigured to find sources and resources in conventional directories src/name/language and src/name/resources (at least with java, groovy … plugins).

The method srcDir adds new directories to the existing ones. And since the directories given are the same as the default ones, one obtains a duplicated path warning.

Either use setSrcDirs which overrides existing directories with given ones srcDirs = ['foo/bar'] // note the = leading to the call to setSrcDirs or, even better in this very case, keep the default ones:

sourceSets {
    funcTest {
        groovy {
            compileClasspath += sourceSets.main.compileClasspath // required to compile groovy
        }
    }
}

Thanks for a reminder. I reported it as a regression: https://github.com/gradle/gradle/issues/13578

Gradle 7.0 is on its way…