Support for excluding module-info.java (language level 8)
We have a project with about 50 modules which we have migrated to Java 11 with module support. We want the intellij project to work on Java 8 as well, since that is our target during this transition.
With Intellij we want to to switch between java 8 and Java 11 (back and forth). This does not work well since even when the project is configured to use JDK 8 (and 8 language level) it looks at module-info.java and adds --module-path to compiler command line.
A project level option to disable auto discovery of module-info.java and instead ignore module-info.java would be useful. Such an option would help during this transition to JPMS (which may go on for years).
In Maven we have adopted two strategies,
a) Compile with Java 8 and use moditect plugin to patch in module-info.java (it is easy to exclude module-info.java from build, this is the option we are looking for in Intellij)
b) Compile with JDK 11. Due to external dependencies with split packages this does not work for some modules and we resort to option a) in those case. Since this option does not work with Java 8, it is used only for internal testing.
Both our build and runtime works fine with Java 8 & 11. Only issue is with our IntelliJ project where we want to continue working with Java 8 with the module-info.java still present.
Please sign in to leave a comment.
Please vote/comment for the related known issue on tracker: https://youtrack.jetbrains.com/issue/IDEA-185108 .