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 7099825f31..6b213d77d6 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 @@ -99,7 +99,7 @@ public class LiquibaseAutoConfiguration { liquibase.setDatabaseChangeLogLockTable(this.properties.getDatabaseChangeLogLockTable()); liquibase.setDropFirst(this.properties.isDropFirst()); liquibase.setShouldRun(this.properties.isEnabled()); - liquibase.setLabels(this.properties.getLabels()); + liquibase.setLabelFilter(this.properties.getLabelFilter()); liquibase.setChangeLogParameters(this.properties.getParameters()); liquibase.setRollbackFile(this.properties.getRollbackFile()); liquibase.setTestRollbackOnUpdate(this.properties.isTestRollbackOnUpdate()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java index 7dea8fc686..1207db3860 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java @@ -22,6 +22,7 @@ import java.util.Map; import liquibase.integration.spring.SpringLiquibase; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.util.Assert; /** @@ -111,7 +112,7 @@ public class LiquibaseProperties { /** * Comma-separated list of runtime labels to use. */ - private String labels; + private String labelFilter; /** * Change log parameters. @@ -248,12 +249,23 @@ public class LiquibaseProperties { this.url = url; } + public String getLabelFilter() { + return this.labelFilter; + } + + public void setLabelFilter(String labelFilter) { + this.labelFilter = labelFilter; + } + + @Deprecated + @DeprecatedConfigurationProperty(replacement = "spring.liquibase.label-filter") public String getLabels() { - return this.labels; + return getLabelFilter(); } + @Deprecated public void setLabels(String labels) { - this.labels = labels; + setLabelFilter(labels); } public Map getParameters() { 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 da2c65f98d..272f4f2032 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 @@ -296,10 +296,18 @@ class LiquibaseAutoConfigurationTests { } @Test - void overrideLabels() { + void overrideLabelFilter() { this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) - .withPropertyValues("spring.liquibase.labels:test, production") - .run(assertLiquibase((liquibase) -> assertThat(liquibase.getLabels()).isEqualTo("test, production"))); + .withPropertyValues("spring.liquibase.label-filter:test, production").run(assertLiquibase( + (liquibase) -> assertThat(liquibase.getLabelFilter()).isEqualTo("test, production"))); + } + + @Test + @Deprecated + void overrideLabelFilterWithDeprecatedLabelsProperty() { + this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) + .withPropertyValues("spring.liquibase.labels:test, production").run(assertLiquibase( + (liquibase) -> assertThat(liquibase.getLabelFilter()).isEqualTo("test, production"))); } @Test diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index e8f021f26c..7746dfd3e1 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -845,7 +845,7 @@ bom { ] } } - library("Liquibase", "4.13.0") { + library("Liquibase", "4.16.0") { group("org.liquibase") { modules = [ "liquibase-cdi",