module-info.java just causes problems

David M. Lloyd david.lloyd at redhat.com
Wed May 11 14:44:58 UTC 2016


On 05/11/2016 09:21 AM, Stephane Epardaud wrote:
> I don't understand the problem with the module-info.java class. We also
> repackage jars to add module descriptors (for OSGi, Maven and JBoss
> Modules) and for Jigsaw we generate the `module-info.class` file when we
> need to repackage them. Between this binary format and XML or
> MANIFEST.MF, I don't see why it makes a big difference?
>
> I wouldn't recompile the module, though, just as I don't recompile them
> when we change the other manifests.

If you have a .class file, you have to generate it with something.  I 
think Alan is arguing that it should be done with javac, but we'd likely 
end up using something else.  In our case, just editing an XML file and 
doing "git commit" is easier than running a tool to read and update a 
binary descriptor inside an artifact though, particularly as we don't 
package the actual artifacts.  Thus we'd have to package a textual 
descriptor of some sort, to which we'd then have to apply a tool in 
order to update our final packaged artifacts, making it that much more 
difficult to use artifacts that already exist (e.g. from Maven).

In addition it is common for our users to examine or modify module 
descriptors; having them be external is very useful for this purpose.

We also allow features like specification of properties for modules 
which can be read, specification of module permission sets, and 
filtering of artifact resources and module dependencies in various ways.
-- 
- DML


More information about the jigsaw-dev mailing list