Manifest resolution order in multi-release jar
Alan Bateman
Alan.Bateman at oracle.com
Thu Oct 4 17:41:50 UTC 2018
On 04/10/2018 08:35, Luke Hutchison wrote:
> JEP 238 says "JAR metadata, such as that found in the MANIFEST.MF file
> and the META-INF/services directory, need not be versioned." However,
> if a manifest file is present in the base layer /and/ a version layer,
> what are the correct semantics? e.g.
>
> META-INF/MANIFEST.MF :
>
> Multi-Release: true
> X: 1
> Y: 2
>
> META-INF/versions/9/META-INF/MANIFEST.MF :
>
> X: 3
The intention is that the META-INF directory cannot be versioned. I
agree the JEP and the JarFile API spec isn't very clear on this point.
The implementation does handle it correctly, meaning getJarEntry will
locate the resource in top-level META-INF directory, not the versioned
section. It will also not find resources that are only present in the
META-INF directory of versioned sections.
-Alan
More information about the jigsaw-dev
mailing list