jdeps --generate-open-module

Mandy Chung mandy.chung at oracle.com
Tue May 16 16:00:38 UTC 2017


> On May 15, 2017, at 12:43 PM, Sander Mak <sander.mak at luminis.eu> wrote:
> 
> When executing `jdeps --generate-module-info ./out <jar>`, a module descriptor exporting all packages is created. When using `--generate-open-module`, a module descriptor with an open module is generated, but no packages are exported. I would expect to be able to generate a module descriptor that is as close to the automatic module behavior of the JAR in question, as starting point for modularization. There seems to be no way to generate an open module exporting all packages, which is the closest to automatic module behavior as possible. What's the intended use-case of `--generate-open-module` as it stands?


jdeps --generate-module-info generates a normal module exporting all packages. To make it an open module (that exports all packages), you can use this option and then add “open” keyword in the generated module-info.

They may be cases for an open module with no exports for example for frameworks to access reflectively.  jdeps -—generate-open-module is the option to generate such module-info.java.  Of course it’s easy for jdeps to generates `exports` for all packages in this case.  This gives the author the chance to consider whether a module should open all packages for reflective access as well as exporting all packages.

Mandy



More information about the jigsaw-dev mailing list