Support extracting executable war files - #51389
Open
mohannamburu18 wants to merge 1 commit into
Open
Conversation
Running the tools jarmode extract command against an executable war failed with "Invalid library location WEB-INF/lib-provided/...". IndexedJarStructure assumed that every entry listed in classpath.idx lives beneath the single directory named by the Spring-Boot-Lib manifest attribute. An executable war also places its provided dependencies, including the embedded container, in WEB-INF/lib-provided and records them in the index, so the first such entry aborted the command. Track the library locations as a list rather than a single value and, when the archive is a war, include WEB-INF/lib-provided alongside WEB-INF/lib. This matches WarLauncher, which already treats both directories as sources of libraries at runtime. Entries outside of the known locations continue to be rejected. See spring-projectsgh-51367 Signed-off-by: Mohan Krishna Namburu <mohannamburu1343@gmail.com>
Author
mohannamburu18
marked this pull request as draft
August 17, 2026 12:54
mohannamburu18
marked this pull request as ready for review
August 17, 2026 12:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running the tools jarmode extract command against an executable war failed
with "Invalid library location WEB-INF/lib-provided/...". IndexedJarStructure
assumed that every entry listed in classpath.idx lives beneath the single
directory named by the Spring-Boot-Lib manifest attribute. An executable war
also places its provided dependencies, including the embedded container, in
WEB-INF/lib-provided and records them in the index, so the first such entry
aborted the command.
Track the library locations as a list rather than a single value and, when the
archive is a war, include WEB-INF/lib-provided alongside WEB-INF/lib. This
matches WarLauncher, which already treats both directories as sources of
libraries at runtime. Entries outside of the known locations continue to be
rejected.
Six tests have been added to IndexedJarStructureTests covering war library
resolution, provided-library resolution, the generated launcher Class-Path,
and the retained validation for unknown locations.
Note that war static resources outside WEB-INF/classes (JSPs, web.xml) are
still not carried into the extracted application. Happy to address that here
if you would prefer it in the same change.
Addresses #51367