alternative packaging; module declaration not packaged with module contents
Andrew Dinn
adinn at redhat.com
Thu Jul 28 12:17:05 UTC 2016
On 28/07/16 12:12, Alan Bateman wrote:
> OOTB, the JDK supports modular JARs and exploded modules at compile-time
> and run-time. There is also a niche format called JMOD for packaging
> modules that are only consumed at link time, interesting when creating
> custom run-time images with jlink, probably not interesting in this thread.
>
> If you want to use alternative packaging, or store the module
> declarations separate to the module contents, then you will need to
> develop your own ModuleFinder. There are are a number of classes in the
> API that need to be implemented but it shouldn't be too difficult. One
> method to point out is ModuleDescriptor.read to read the binary form and
> combine it with the set of packages in the module. All the docs are
> online [1]. This all assumes you are doing dynamic configuration and
> creating your own layer of modules of course, there is nothing that
> allows using custom packaging formats during startup (chicken 'an egg
> issue of course). I don't have a suggestion for compile-time but from
> your other mail then it sounds more like patching, no mention of
> recompiling modules.
Ok, so when you say that there is
"nothing that requires the compiled form of the module declaration to
be in the same artifact as the module contents."
what you are seem to be saying is that there is nothing short of:
a protocol defining a standard format for storing a module descriptor
separate from its implementation classes
standard tooling for packaging module contents separate from their
declarations in said putative format
a standard library capable of re-uniting a module descriptor with the
associated module contents at module load time should they be packaged
in said putative format
So, this seems to be very much a theoretical rather than an actual
option we are discussing here.
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the jigsaw-dev
mailing list