How to customize sourceSets with resources folder that not within project dirs?

 sourceSets { 
        main { 
               java { 
                        srcDir 'src/main/java' 
              resources { 
                        **//relative path---dfy-static/web is not within the root    project!!!** 
                        **srcDir '../../dfy-static/web'** 
                        srcDir    'src/main/resources' 

It worked in STS,but failed in idea with errors below:

Can’t register given path of type “RESOURCE” because it’s out of content root.
Error: Content root:'E:/ideanplace/dfy-parent/dfy-web’
Given path:‘E:\ideaplace\dfy-static\web’

Can anyone help??

I believe this is just a limitation of IntelliJ. Perhaps use a symlink?

Thanks a lot! I’ll try ,a little more details about symlink usage in gradle on windows will not be any more great!!

Great!I sove it as you said,thank you!