diff --git a/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java b/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java index d299454c072..e6ab5818d3c 100644 --- a/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java +++ b/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java @@ -39,7 +39,7 @@ public class WebResourcesRuntimeHints implements RuntimeHintsRegistrar { ClassLoader classLoaderToUse = (classLoader != null) ? classLoader : getClass().getClassLoader(); String[] locations = DEFAULT_LOCATIONS.stream() .filter((candidate) -> classLoaderToUse.getResource(candidate) != null) - .map((location) -> location + "*") + .map((location) -> location + "**") .toArray(String[]::new); if (locations.length > 0) { hints.resources().registerPattern((hint) -> hint.includes(locations)); diff --git a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java index 3947eee6352..4ed0705e420 100644 --- a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java +++ b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHintsTests.java @@ -44,13 +44,13 @@ class WebResourcesRuntimeHintsTests { RuntimeHints hints = register( new TestClassLoader(List.of("META-INF/resources/", "resources/", "static/", "public/"))); assertThat(hints.resources().resourcePatternHints()).singleElement() - .satisfies(include("META-INF/resources/*", "resources/*", "static/*", "public/*")); + .satisfies(include("META-INF/resources/**", "resources/**", "static/**", "public/**")); } @Test void registerHintsWithOnlyStaticLocations() { RuntimeHints hints = register(new TestClassLoader(List.of("static/"))); - assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static/*")); + assertThat(hints.resources().resourcePatternHints()).singleElement().satisfies(include("static/**")); } @Test