Create a SourceSet only for resources?

I created my own source set to define some resources, which are the input of a custom task.

sourceSets {

As I can see, this definition automatically creates a task compileMySourceSetJava. Since this source set will only contain resources and no Java code, these automatically created tasks to compile Java sources are not really needed.

Is there a way to define a source set as resource-only?
Am I misusing the source set concept and should use something different?

While the extra compile task does technically impact performance, due to fact that it exists, the task should never do anything since there is no source. Unless you’ve got a very large number of these tasks and they’re are causing a noticeable amount of build time, I would simply leave them be.

Is there a specific issue they’re causing for you?

We currently have no issue with it. I was primarily just trying to remove some cognitive load as these tasks also appear in the IntelliJ gradle model, so I was just wondering if there was an easy way to simply remove them.

So, like you suggest I will simply leave them be.

Have you tried this

you can do

sourceSets {
main {
resources {