'What's wrong with my build.gradle - sourceSets - srcDir

This is my sourceSets configuration in build.gradle v7.1.1:

sourceSets {
    test {
        resources {
            srcDir "src/test/resources/sql"
        }
    }
}

And when i run gradlew clean test, it's working fine i.e BUILD SUCCESSFUL. But, i am seeing a red-cross overlay as follows on my IDE(Spring Tool Suite v4.11.1.RELEASE if that matters): enter image description here and this is the corresponding Problems view pane error:

enter image description here

When i remove the srcDir configuration, there is no more red-cross overlay.



Solution 1:[1]

I stumbled upon the same problem. And when navigated to the Problems Panel, it was showing the error message caused by the old builds. When I manually deleted the error message and rebuild the project, the issue was resolved.

Seems like some cache issue with eclipse.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ananya Verma