问题
I have a JPMS framework that dynamically creates JPMS layers and add modules to them. After some tests it seems to me that --add-opens
JVM parameter works only for the boot layer
, I mean the layer that is created when application starts.
So, the question - does --add-opens
work for dynamically created layers in JPMS?
Concrete example
--add-opens java.base/java.lang=weld.servlet.shaded
will java.base/java.lang
be opened to weld.servlet.shaded
if weld.servlet.shaded
is in dynamically created layer?
回答1:
The answer was given by @AlanBateman
The --add-opens CLI option is for the boot layer only.
来源:https://stackoverflow.com/questions/60955701/does-add-opens-work-for-dynamically-created-layers-in-jpms