Support for multiple modules in one JAR-File
snfuchs at gmx.de
Sat Sep 12 09:49:50 UTC 2015
reading the State of the Module System, I got the impression that a
modular jar file can only contain one module.
However, many applications, I have seen, fold all its dependencies into
one big jar file (See m  and  for tool support).
This is done to:
* reduce startup times for webstart applications
* ease distribution and deployment
* enable efficient obfuscating of the resulting jar (see )
So I think it is critical to support multiple modules in one jar file,
if the module system is to be adopted beyond the jdk.
In this context I find the convention, of placing a module-info.java or
module-info.class in the root of the jar file, a poor choice.
It should be named after the module name (e.g.:
Besides, I think using a simple text file to declare the module
dependencies would have been the better option.
No special tools would be needed to inspect the dependencies of a jar
file, when the source is not available.
More information about the jpms-spec-comments