Hello all

JPMS support in the compiler plugin (not yet merged) has reached a point where it can be used on some real projects. The Maven 3 way to make a modular project is still supported, but the proposed alternative for better use of JPMS is described here:

 * 
https://github.com/Geomatys/maven-compiler-plugin/wiki/User-guide#modular-project
 * 
https://github.com/Geomatys/maven-compiler-plugin/wiki/Migration#modular-projects

Note that the module source hierarchy described in above link is not an invention of this compiler plugin work. It come from javac [1]. The new plugin does not force anyone to adopt that organization, but makes possible to use it for those who want. In the same way, the additional directory that appears in the output classes also come from javac. It appears when we use the `--module-source-path` option instead of `--source-path`. Again, this is an opt-in: by default, the plugin behaves as in Maven 3. But if the sources are declared in the way suggested in above links, then the differences documented above appear.

The pull request has not been created yet. This email is for giving a chance to anyone to comment before to go further. Note that the work is not finished. Some remaining tasks are:

 * Support modular + multi-release projects (currently, it is one or
   the other but not both).
 * Provide a substitute to the overriding of `module-info.java` in
   tests when the developer needs something more advanced than the
   --patch-module and --add-reads options automatically added by the
   compiler. In the meantime, developers can workaround with
   |<testCompilerArgs>| plugin configuration.

Martin

[1]https://docs.oracle.com/en/java/javase/24/docs/specs/man/javac.html#module-source-hierarchy

Reply via email to