RFR: 8156499 Update jlink to support creating images with modules that are packaged as multi-release JARs

Alan Bateman Alan.Bateman at oracle.com
Sun Aug 21 06:19:23 UTC 2016


On 21/08/2016 03:49, Mandy Chung wrote:

>
> I think it’s time to enumerate several test cases of a multi-release Jar content, e.g. a MRJAR with a new concealed package in versioned entries but not in the base entry (I believe that’s allowed?? version 9 & 10 entries that makes sure versioned 10 entries are skipped.  It should also check the module-info.class with different requires and ensure that the image jlink created contains the module-info.class of the right version.  This would help the review of this change.
I agree on the test scenarios as it's tricky to get them all right.

On concealed packages then the intention is that they don't vary by JDK 
version, this means the versioned section can't add packages. This isn't 
a real limitation of course, it just means that the set of concealed 
packages in the base version might need to list additional packages. The 
jar tool has support for generating this but I don't know how many 
scenarios are tested.

>
>
> I think ModularJarArchive is the right place to add the versioned entries support.  JarArchive should probably be renamed to ZipArchive (that’s an existing code).
I agree.


>
> Version of JarFile
>
>   221         jarFile = new JarFile(file.toFile(), true, ZipFile.OPEN_READ, JarFile.runtimeVersion());
>
> JarFile::runtimeVersion is the version of the jlink tool.  You should not use the version of the jlink runtime.  Instead, this should use the version of java.base which will be the runtime version of the image being created.
Right, in the previous mails then I think we agreed to leave this to a 
second phase. The reason is that it requires refactoring in other areas. 
I have changes that Steve will need to do this second phase but for now 
I think it would be good to get the first phase done as it's the phase 
with all the tricky scenarios.

-Alan


More information about the jigsaw-dev mailing list