Commit Graph

8 Commits

Author SHA1 Message Date
Moritz Halbritter
9def6f86c9 Keep track of written jar entries to not duplicate them
Closes gh-40903
2024-05-27 12:18:00 +02:00
Moritz Halbritter
de560a933c Extract all files under META-INF
Closes gh-40456
2024-04-22 13:20:57 +02:00
Phillip Webb
6963bd884b Merge branch '3.2.x' 2024-04-18 12:53:26 -07:00
Phillip Webb
3ed77ae5f3 Polish 2024-04-04 23:45:21 -07:00
Moritz Halbritter
558d811b0a Use JarFile instead of ZipInputStream
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
2024-03-20 12:11:56 +01:00
Moritz Halbritter
9411a4ce99 Adjust defaults for ExtractCommand
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
2024-03-12 11:52:33 +01:00
Moritz Halbritter
7a417503e5 Fix tests on windows 2024-03-07 14:14:24 +01:00
Moritz Halbritter
793aca60d2 Implement extract and list-layers command
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
2024-03-07 13:34:13 +01:00