What problem are you trying to solve here? Is it just that you want a separate container for dependencies? Will customConfiguration contain compiled sources? Are you trying to share test fixtures? I think how you want to use this configuration speaks to the best way to configure it.
I’m sorry I’m not clear on the problem, essentially, I forgot to mention that we also configure intellij to pick up the the “sources” of customConfiguration as “testSources”
so basically, the problem is where intellij couldn’t pick up java sources in customConfiguration, as intellij only understand the dependencies on modules “java sources” and not “java test sources”, so the moment we remove the line “testSourceDirs += sourceSets.customConfiguration.java.srcDirs”, intellij can understand the classes in the customConfiguration.java.srcDirs.
“Is it just that you want a separate container for dependencies? Will customConfiguration contain compiled sources? Are you trying to share test fixtures?”
basically, we have some common test utilities, glue code for cucumber tests, etc… and that’s why you need to extract those common “test code” into separate modules customConfiguration.