I work for a company which developing a JEE application, with huge code base.
We use Intellij IDEA, the .iml and .ipr files are generated by a gradle task.
We have about 20 modules, one has a module library with test scope, which contains all other module .class files.
Every other module has access to it, through transitive dependencies.
I know, it's sounds weird, as I know it's because some integration tests using dependencies from modules which are not in their dependency tree by default.
The problem is, that sometimes Intellij uses these .class files instead of source files, during testing and debugging.
E.g. I run a test class, has some failing test, click on the test name in the Run view and Intellij opens the .class file, not the .java file.
The same happenig sometimes during debug or when trying to jump to an other java file(go to implementation etc.), even if they are in the same module.
I know the problem is, that the mentioned library contains the .class files for every module, but I don't understand why Intellij found those files first instead of the source files.
If remove the .class files, then the integration test failing to compile, so that's not an option.
Can I see somewhere what's the exact class path when Intellij trying to compile modules/run tests/debugging etc?