Hello again Stephen
If you are willing to test the development regarding JPMS, there is the
steps:
* Download Maven 4.0.0-beta4
* Use Maven 4 for building the master branch of
https://github.com/apache/maven-plugin-tools
* Use Maven 4 for building
https://github.com/apache/maven-plugin-testing/pull/44. Use "mvn
install -Denforcer.skip".
* Use Maven 4 for building
https://github.com/Geomatys/maven-compiler-plugin/tree/beta2. Use
"mvn install -Denforcer.skip".
* Set the compiler version to "4.0.0-beta-2-SNAPSHOT" in your project.
* See
https://github.com/Geomatys/maven-compiler-plugin/wiki/Incompatible-changes
necessary changes in project configuration (note: I was wrong
yesterday, the current prototype does not allowed anymore to have
module-info in both main and test. The latter is replaced by
automatically generated compiler options).
Below are the new features. They are not all tested extensively. If they
are not working as expected, I would like to know so we can fix them.
Note: the following apply to the compiler plugin only. Other plugins
have not yet been updated.
* In project dependencies, add <type>modular-jar</type> for forcing
the compiler to put the JAR dependency on the module path instead of
trying to guess.
* Conversely, use <type>classpath-jar</type> for forcing the compiler
to put the JAR dependency on the class-path.
* The default (<type>jar</type>) tries to guess with the same
heuristic as the current compiler (Maven 3), but I would recommend
to be explicit instead.
* Use <type>modular-processor</type> or
<type>classpath-processor</type> for adding the dependency on the
annotation processor module-path or class-path. This is in
replacement for the previous compiler configuration: dependencies
are managed in a more unified way (same will apply for taglet,
doclet, etc.).
Regarding white-box testing in a modular project:
* The plugin uses the --patch-module option for specifying the
directories of test classes to the Java compiler.
* The plugin adds the following options for test dependencies that are
not present in the main dependencies (typically JUnit):
o --add-modules and --add-reads for compile-time dependencies.
o --add-modules only for runtime-time dependencies (typically
services to be discovered with java.util.ServiceLoader).
o --add-reads ALL-UNNAMED if at least one compile-time test
dependency is not modular.
Planed for Surefire (not yet done):
* The plugin will adds the same --add-reads and --add-modules options
as the compiler, maybe using shared Maven code for ensuring consistency.
* The plugin will adds --add-exports module/package=junit (or whatever
test engine is used) options for non-exported packages that have
test classes.
Above will be ajusted according experience and feedbacks.
Martin