RFR: JDK-8220702: compiling in the context of an automatic module disallows --add-modules ALL-MODULE-PATH

Alex Buckley alex.buckley at oracle.com
Thu Apr 11 20:40:37 UTC 2019

On 4/11/2019 12:00 PM, Christian Stein wrote:
> I'm not sure if this helps in any regards -- here [1] is a draft PR
> that adds explicit module descriptors to all JUnit 5 modules.
> This PR uses javac in multi-module mode and --patch-module
> to access the already (with --release 8) compiled classes of
> each module.

Thanks Christian. Ultimately you're invoking javac like so:

javac --patch-module org.junit.platform.commons=
       --module-version 1.5.0-SNAPSHOT

where it is interesting to see --patch-module indicating the putative 
content of a module before the module-info.java file which declares the 
module into existence has been compiled!

You even get the benefit of error-checking for module-info.java, e.g., 
that its `exports` refer to packages which truly exist in the module. I 
suppose if you just put junit-platform-commons/build/classes/java/main 
on the --module-path then you would not get this checking.

The first point for using --patch-module at compile time goes to Jan for 
building tests as if members of automatic modules; you get the second 
point for building module declarations as if members of ... well, 


More information about the compiler-dev mailing list