Classpath during plugin execution is different from compile time?


I am facing a strange classpath issue with a plugin I wrote ( , which depends heavily on , which itself depends on ).

On a multi-module project, I have infrastructure module that depends on domain. it compiles fine, the build.gradle file in infrastructure contains :

dependencies {
implementation project(’:domain’)


now, when my plugin (with a task checkRules) executes, it will execute for infrastructure module : it’s going to perform some quality checks, and one of them applies for classes in infrastructure that implement an interface defined in domain .

the plugin finds MyClassImpl in infrastructure module, but when it tries to load the interface from domain module, it doesn’t find it. I have hardcoded few things and added debug statements a bit everywhere : the bit of code that is executed is available here :

It’s the first time I implement a check that needs references across modules - apart from this, the plugin works as expected.

Is there a trick for a plugin to have visibility across all modules of a multi-modules project ?