From b9f75bc49d1afa719b6e34b8635e32317c72639b Mon Sep 17 00:00:00 2001 From: Andrii Bohutskyi Date: Thu, 23 Mar 2023 11:34:05 +0200 Subject: [PATCH] fix(Liquibase): Include all Liquibase resources to native application gh-34678 --- .../autoconfigure/liquibase/LiquibaseAutoConfiguration.java | 2 +- .../liquibase/LiquibaseAutoConfigurationTests.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java index c6b65c50e3e1..d7d7026f476f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java @@ -175,7 +175,7 @@ static class LiquibaseAutoConfigurationRuntimeHints implements RuntimeHintsRegis @Override public void registerHints(RuntimeHints hints, ClassLoader classLoader) { - hints.resources().registerPattern("db/changelog/db.changelog-master.yaml"); + hints.resources().registerPattern("db/changelog/*"); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java index f61a13998325..bcd208784819 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java @@ -423,8 +423,11 @@ void whenCustomSpringLiquibaseIsDefinedThenJooqDslContextDependsOnSpringLiquibas void shouldRegisterHints() { RuntimeHints hints = new RuntimeHints(); new LiquibaseAutoConfigurationRuntimeHints().registerHints(hints, getClass().getClassLoader()); + assertThat(RuntimeHintsPredicates.resource().forResource("db/changelog/")).accepts(hints); assertThat(RuntimeHintsPredicates.resource().forResource("db/changelog/db.changelog-master.yaml")) .accepts(hints); + assertThat(RuntimeHintsPredicates.resource().forResource("db/changelog/tables/init.sql")) + .accepts(hints); } private ContextConsumer assertLiquibase(Consumer consumer) {