IMO this will overcomplicate things and I don't see the real benefits of
it.
You've summed up only a small number of plugins, but in the end almost
every plugins needs to become aware of this new structure, because both
the input and output structure will change(all (re)source-directories will
get an extra path and there will be multiple output-directories, i.e.
classes/<module>/).
The options to compile multiple modules all at once is a direct result of
the modularization of the JDK itself, and the need to build it all at once
without third party tool. Maven already supports this since the early
days, but with its own structure.
You can give it a try to patch the plugins, but I'm afraid you'll jump
from one failing plugin to the next.
thanks,
Robert
On Thu, 26 Apr 2018 19:01:53 +0200, Martin Desruisseaux
<martin.desruisse...@geomatys.com> wrote:
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: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org