Skip to content

Support extracting executable war files - #51389

Open
mohannamburu18 wants to merge 1 commit into
spring-projects:mainfrom
mohannamburu18:gh-51367
Open

Support extracting executable war files#51389
mohannamburu18 wants to merge 1 commit into
spring-projects:mainfrom
mohannamburu18:gh-51367

Conversation

@mohannamburu18

Copy link
Copy Markdown

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

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>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 17, 2026
@mohannamburu18

Copy link
Copy Markdown
Author

Support extracting executable war files- #51389
#51389

@mohannamburu18
mohannamburu18 marked this pull request as draft August 17, 2026 12:54
@mohannamburu18
mohannamburu18 marked this pull request as ready for review August 17, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants