Skip to content

Conversation

@vietj
Copy link
Member

@vietj vietj commented Dec 11, 2023

Best effort in Vert.x file resolver to support jar file resolution for simple jar file entries without recursion when the URL to resolve provides a custom protocol that provides a valid jar url connection to a jar file. The file resolver unpacking mechanism is changed to get the jar file to unpack from the jar url connection instead of reconstructing the jar URL deduced from the initial URL to resolve (according to what the classloader resolved).

The extraction of the list of jar entries from the URL has been rewritten in a more generic fashion with a relaxed parsing to accommodate URL with a file that use custom conventions which actually seems fine with the jar url documentation.

This provides a best effort support for Spring boot nested custom protocol https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#appendix.executable-jar.nested-jars

@vietj vietj added this to the 4.5.1 milestone Dec 11, 2023
@vietj vietj self-assigned this Dec 11, 2023
…separator regardless of the prefix (.zip,.war,.jar) we used to include, in order to deal with custom JarFile implementations.

The jar URL unpacking for support nested directory was also not correctly implemented although working due to the previous way to analyze the list of entries of a jar URL. The proper way to support nested directories is to unpack the nested directory as a resource and then copy it (relocate) to the correct cache path, e.g. unpack jar:file:/path/to/nesting.jar!/xxx-inf/classes and then copy xxx-inf/classes to the root of the cache, so the subsequent lookup for the nested part designates the correct file. This has been implemented in order to support this properly in a way compatible with the list of entries correction.
@vietj vietj force-pushed the custom-jar-file-resolver-4.x branch from 088baac to 1e56721 Compare December 12, 2023 08:37
@vietj vietj added the bug label Dec 12, 2023
@vietj vietj merged commit 1884599 into 4.x Dec 12, 2023
@vietj vietj deleted the custom-jar-file-resolver-4.x branch December 12, 2023 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileResolvingImpl does not resolve files from JAR built with spring-boot-maven-plugin 3.2.0

2 participants