Alternatively, would the following addition in Maven plugins be acceptable?


maven-compiler-plugin
---------------------

If the plugin find module-info.java in the root source directory or does
not find that file at all, behave as today: javac is invoked with
--source-path option set to ${baseDir}/src/main/java.

If the plugin find module-info.java in at least one sub-directory at a
depth of 1 (i.e. we do not scan sub-directories recursively), replace
the --source-path option by --module-source-path. Everything else stay
the same (the argument still ${baseDir}/src/main/java). This would us to
put Jigsaw modules in src/main/java. We would not have "1 Maven module
== 1 Jigsaw module", but this is a problem I'm willing to handle on my side.


maven-javadoc-plugin
--------------------

Same maven-compiler-plugin: use --module-source-path option instead of
--source-path option if it detects that module-info.java files are in
directories; everything else unchanged.


maven-jar-plugin
----------------

If it detects that module-info.class are in directories, execute the jar
command for each of those directories. Otherwise behave as today. I
agree that it causes an issue when we need to change the MANIFEST.MF
content per JAR file (in particular the main-class attribute), but I'm
fine to leave this problem apart for now; the jar tools has options for
updating a JAR file after creation (e.g. jar --update --main-class …).


Deployment may be the biggest issue, but maybe not unsolvable. I
understand that in Maven "1 pom.xml == 1 artifact", but my proposal is
to accept that an artifact can be either a single JAR file or a
collection of Jigsaw modules. This would be not much different than the
WAR packaging, which is a ZIP file containing JAR files.

Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to