Skip to content

Commit 0f5eb46

Browse files
committed
Upgrade to Liquibase 4.31.0
Closes gh-43896
1 parent 8159674 commit 0f5eb46

File tree

4 files changed

+52
-2
lines changed

4 files changed

+52
-2
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ SpringLiquibase liquibase(ObjectProvider<DataSource> dataSource,
134134
if (properties.getUiService() != null) {
135135
liquibase.setUiService(UIServiceEnum.valueOf(properties.getUiService().name()));
136136
}
137+
if (properties.getAnalyticsEnabled() != null) {
138+
liquibase.setAnalyticsEnabled(properties.getAnalyticsEnabled());
139+
}
140+
if (properties.getLicenseKey() != null) {
141+
liquibase.setLicenseKey(properties.getLicenseKey());
142+
}
137143
customizers.orderedStream().forEach((customizer) -> customizer.customize(liquibase));
138144
return liquibase;
139145
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ public class LiquibaseProperties {
154154
*/
155155
private UiService uiService;
156156

157+
/**
158+
* Whether to send product usage data and analytics to Liquibase.
159+
*/
160+
private Boolean analyticsEnabled;
161+
162+
/**
163+
* Liquibase Pro license key.
164+
*/
165+
private String licenseKey;
166+
157167
public String getChangeLog() {
158168
return this.changeLog;
159169
}
@@ -331,6 +341,22 @@ public void setUiService(UiService uiService) {
331341
this.uiService = uiService;
332342
}
333343

344+
public Boolean getAnalyticsEnabled() {
345+
return this.analyticsEnabled;
346+
}
347+
348+
public void setAnalyticsEnabled(Boolean analyticsEnabled) {
349+
this.analyticsEnabled = analyticsEnabled;
350+
}
351+
352+
public String getLicenseKey() {
353+
return this.licenseKey;
354+
}
355+
356+
public void setLicenseKey(String licenseKey) {
357+
this.licenseKey = licenseKey;
358+
}
359+
334360
/**
335361
* Enumeration of types of summary to show. Values are the same as those on
336362
* {@link UpdateSummaryEnum}. To maximize backwards compatibility, the Liquibase enum

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -541,6 +541,24 @@ void whenCustomizerBeanIsDefinedThenItIsConfiguredOnSpringLiquibase() {
541541
.run(assertLiquibase((liquibase) -> assertThat(liquibase.getCustomizer()).isNotNull()));
542542
}
543543

544+
@Test
545+
void whenAnalyticsEnabledIsFalseThenSpringLiquibaseHasAnalyticsDisabled() {
546+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
547+
.withPropertyValues("spring.liquibase.analytics-enabled=false")
548+
.run((context) -> assertThat(context.getBean(SpringLiquibase.class))
549+
.extracting(SpringLiquibase::getAnalyticsEnabled)
550+
.isEqualTo(Boolean.FALSE));
551+
}
552+
553+
@Test
554+
void whenLicenseKeyIsSetThenSpringLiquibaseHasLicenseKey() {
555+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
556+
.withPropertyValues("spring.liquibase.license-key=a1b2c3d4")
557+
.run((context) -> assertThat(context.getBean(SpringLiquibase.class))
558+
.extracting(SpringLiquibase::getLicenseKey)
559+
.isEqualTo("a1b2c3d4"));
560+
}
561+
544562
private ContextConsumer<AssertableApplicationContext> assertLiquibase(Consumer<SpringLiquibase> consumer) {
545563
return (context) -> {
546564
assertThat(context).hasSingleBean(SpringLiquibase.class);

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ bom {
12031203
releaseNotes("https://github.com/lettuce-io/lettuce-core/releases/tag/{version}")
12041204
}
12051205
}
1206-
library("Liquibase", "4.30.0") {
1206+
library("Liquibase", "4.31.0") {
12071207
group("org.liquibase") {
12081208
modules = [
12091209
"liquibase-cdi",

0 commit comments

Comments
 (0)