I have a large maven project in which all the maven modules except for one have module-info.java. For that one I have provided an Automatic-Module-Name in MANIFEST.MF, call it 'x', The subproject (call it 'y') that uses x declares it in its module-info.java and compiles and runs successfully. However, IDEA marks the declaration and all classes belonging to x in red.
In y's module-info.java I see 'requires x;' marked 'Module not found'.
The classes are all marked 'Package 'x' is declared in the unnamed module but module 'y' does not read it'.
This appears to be a problem only in the IDE; as I said the build is OK. If I remove the declaration it fails. What is the problem?