I have a multi module maven project structure like this:
parent
A
B
C
(so modules A, B and C are my modules "inside" the parent).
A is not modularized, while B and C are (A just contains a very small main method). Module A depends on B and C, and B depends on C.
It all works just fine -- all the module dependencies, module-info files etc are working correctly.
But I now have a problem. B compiles some Java code on the fly in memory using the JavaCompiler API. An example piece of code might be:
package whatever;
import C.X;
...
So the compiled code is using class X in module C.
All the generated code used to run fine before I modularized my projects. B contains a custom JavaFileManager extending ForwardingJavaFileManager and some custom SimpleJavaFileObjects.
When I compile the above code now the compiler says that it cannot find A.X.
I presume I have to configure my custom JavaFileManager to handle modules somehow, but I have not been able to get this to work.
There are some posts on stackoverflow about the JavaCompiler API but almost all are about what worked before Java modules were introduced.
So I was wondering if anyone could point me to a discussion, or even some code, that shows how to handle the above issue correctly.
thanks