Update jar mode launchers to catch all exceptions and return a non-zero
exit code. This refinement also allows us to consolidate the existing
error reporting logic to a central locations. Modes that wish to report
a simple error rather than a full stacktrace can throw the newly
introduced `JarModeErrorException`.
Fixes gh-43435
ZipInputStream can't cope with some non-deflated entries, see
https://bugs.openjdk.org/browse/JDK-8143613.
JarFile works better, but it doesn't support creation time / access
time.
See gh-38276
It now extracts the contents of the JAR in a folder named after the JAR
without the extension. It now also checks if the folder is empty.
There's a new --force option to skip those checks.
The "runner.jar" is now named like the uber JAR from which the
extraction has been started.
See gh-38276
Adds a new jarmode called 'tools'. This provides two commands,
'extract' and 'list-layers'. list-layers is the same as list from
the layertools.
extract is able to extract the JAR in four different modes:
- CDS compatible extraction with libraries in a lib folder and a runner
.jar
- CDS compatible as above, but with layers
- Launcher based
- Launcher based with layers. This is essentially the same as extract
from the layertools
The commands in layertools have been deprecated in favor of the commands
in 'tools'.
This also changes the behavior of layers.enabled from the Gradle and
Maven plugin: before this commit, layers.enabled prevents the inclusion
of the layer index file as well as the layertools JAR.
After this commit, layers.enabled only prevents the inclusion of the
layer index file.
layer.includeLayerTools have been deprecated in favor of includeTools,
and the layertools JAR has been renamed to tools.
Closes gh-38276