Jar tool to transform a plain old JAR file to a modular JAR
Sean Mullan
sean.mullan at oracle.com
Fri Apr 8 14:21:38 PDT 2011
On 4/8/11 3:58 PM, Mandy Chung wrote:
>
>
> This week I pushed the changeset to support modular JAR Files [1].
> Below is a proposal to enhance the jar command-line tool to transform
> a plain old JAR file into a modular JAR file by adding module metadata
> to ease migration. It's also posted at:
> http://cr.openjdk.java.net/~mchung/jigsaw/modular-jar-files.txt
>
> Feedback, comments?
>
> Proposal of jar tool enhancement
> =======================
> Modular JAR File
>
> A modular JAR file is a JAR file that contains a single module definition
> file (META-INF/module-info.class). It can be used as a JAR on the class
> path and installed as a module in a module library.
>
> o The META-INF directory
> * module-info.class
>
> The module-info.class file describes the module metadata.
> Grammar of the source file described in [2].
>
> o Signed JAR file
> A modular JAR can be signed in the same way as ordinary JAR.
> If a modular JAR file is signed, the META-INF/module-info.class
> entry must be signed to be installed in a modular library.
>
> Tool to transform a plain old JAR file into a modular JAR
>
> The jar tool will provide the following new options for
> generating a module definition file in a jarfile:
>
> --module={module-name @ version}
This looks like the spaces around the '@' are required.
> Generate META-INF/module-info.class entry in the JAR file.
> * jarfile name tends to be unnamed or contains '-' character.
> The module name will not be inferred from the jarfile name.
> --module-info-java={dir}
> Output module-info.java in the specified directory.
Is this option optional? Will it output to the cwd by default?
--Sean
More information about the jigsaw-dev
mailing list