Skip to content

Commit f11e3f3

Browse files
committed
Adapt to new GraalVM metadata format
This commit updates our web resources patterns due to a change in the GraalVM metadata format. Previously a single `*` was considering a directory and its sub-folders. The same behavior now requires two `*`. Closes gh-47894
1 parent 724f706 commit f11e3f3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
3939
ClassLoader classLoaderToUse = (classLoader != null) ? classLoader : getClass().getClassLoader();
4040
String[] locations = DEFAULT_LOCATIONS.stream()
4141
.filter((candidate) -> classLoaderToUse.getResource(candidate) != null)
42-
.map((location) -> location + "*")
42+
.map((location) -> location + "**")
4343
.toArray(String[]::new);
4444
if (locations.length > 0) {
4545
hints.resources().registerPattern((hint) -> hint.includes(locations));

core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ void registerHintsWithAllLocations() {
4444
RuntimeHints hints = register(
4545
new TestClassLoader(List.of("META-INF/resources/", "resources/", "static/", "public/")));
4646
assertThat(hints.resources().resourcePatternHints()).singleElement()
47-
.satisfies(include("META-INF/resources/*", "resources/*", "static/*", "public/*"));
47+
.satisfies(include("META-INF/resources/**", "resources/**", "static/**", "public/**"));
4848
}
4949

5050
@Test
5151
void registerHintsWithOnlyStaticLocations() {
5252
RuntimeHints hints = register(new TestClassLoader(List.of("static/")));
53-
assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static/*"));
53+
assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static/**"));
5454
}
5555

5656
@Test

0 commit comments

Comments
 (0)