Jar tool to transform a plain old JAR file to a modular JAR

Alan Bateman Alan.Bateman at oracle.com
Mon Apr 11 04:40:48 PDT 2011


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
The proposal mostly looks good to me.

One comment on the options is that I don't think the jar command has any 
GNU-style options yet, it only has the traditional single letter 
options. No issue moving to the new style but it makes me wonder if we 
should introduce GNU-styles for the existing options.

I'm in two minds as to if we need --requires-module as it gets to the 
point where it's just as easy to create and compile the module-info 
yourself. Initially it might be fine to just support --module to create 
the most basic of module-info files. If jar is generating the 
module-info then I agree we need an option to save it somewhere but 
"--module-info=java={dir}" gives the impression that it reads 
{dir}/module-info.java. Maybe needs to be something like 
--save-module-info or --output-module-info?

On the signed JAR issue then maybe jar should emit a warning when it 
updates a signed JAR and that would cover the adding module-info case too.

-Alan.



More information about the jigsaw-dev mailing list