Extract all files under META-INF

Closes gh-40456
This commit is contained in:
Moritz Halbritter
2024-04-22 11:53:26 +02:00
parent 4118de7f59
commit de560a933c
5 changed files with 25 additions and 3 deletions

View File

@@ -62,7 +62,8 @@ class ExtractCommandTests extends AbstractJarModeTests {
"BOOT-INF/lib/dependency-2.jar", "/jar-contents/dependency-2", "BOOT-INF/lib/dependency-3-SNAPSHOT.jar",
"/jar-contents/dependency-3-SNAPSHOT", "org/springframework/boot/loader/launch/JarLauncher.class",
"/jar-contents/JarLauncher", "BOOT-INF/classes/application.properties",
"/jar-contents/application.properties");
"/jar-contents/application.properties", "META-INF/build-info.properties",
"/jar-contents/build-info.properties");
}
private File file(String name) {
@@ -207,6 +208,14 @@ class ExtractCommandTests extends AbstractJarModeTests {
.contains("out/test.jar");
}
@Test
void shouldExtractFilesUnderMetaInf() throws IOException {
run(ExtractCommandTests.this.archive);
File application = file("test/test.jar");
List<String> entryNames = getJarEntryNames(application);
assertThat(entryNames).contains("META-INF/build-info.properties");
}
}
@Nested