Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fed89f9

Browse files
committed
Merge branch '2.7.x'
2 parents 73b7b14 + ce7a3d0 commit fed89f9

File tree

6 files changed

+31
-12
lines changed

6 files changed

+31
-12
lines changed

‎spring-boot-project/spring-boot-autoconfigure/build.gradle‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ dependencies {
9090
exclude group: "commons-logging", module: "commons-logging"
9191
}
9292
optional("org.flywaydb:flyway-core")
93+
optional("org.flywaydb:flyway-sqlserver")
9394
optional("org.freemarker:freemarker")
9495
optional("org.hibernate:hibernate-core-jakarta")
9596
optional("org.hibernate:hibernate-jcache") {

‎spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -32,6 +32,8 @@
3232
import org.flywaydb.core.api.callback.Callback;
3333
import org.flywaydb.core.api.configuration.FluentConfiguration;
3434
import org.flywaydb.core.api.migration.JavaMigration;
35+
import org.flywaydb.core.internal.plugin.PluginRegister;
36+
import org.flywaydb.database.sqlserver.SQLServerConfigurationExtension;
3537

3638
import org.springframework.beans.factory.ObjectProvider;
3739
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
@@ -249,9 +251,8 @@ private void configureProperties(FluentConfiguration configuration, FlywayProper
249251
// No method reference for compatibility with Flyway 6.x
250252
map.from(properties.getOutputQueryResults())
251253
.to((outputQueryResults) -> configuration.outputQueryResults(outputQueryResults));
252-
// No method reference for compatibility with Flyway 6.x
253-
map.from(properties.getSqlServerKerberosLoginFile()).to((sqlServerKerberosLoginFile) -> configuration
254-
.sqlServerKerberosLoginFile(sqlServerKerberosLoginFile));
254+
map.from(properties.getSqlServerKerberosLoginFile()).whenNonNull()
255+
.to(this::configureSqlServerKerberosLoginFile);
255256
// No method reference for compatibility with Flyway 6.x
256257
map.from(properties.getSkipExecutingMigrations())
257258
.to((skipExecutingMigrations) -> configuration.skipExecutingMigrations(skipExecutingMigrations));
@@ -295,6 +296,12 @@ private void configureCreateSchemas(FluentConfiguration configuration, boolean c
295296
}
296297
}
297298

299+
private void configureSqlServerKerberosLoginFile(String sqlServerKerberosLoginFile) {
300+
SQLServerConfigurationExtension sqlServerConfigurationExtension = PluginRegister
301+
.getPlugin(SQLServerConfigurationExtension.class);
302+
sqlServerConfigurationExtension.setKerberosLoginFile(sqlServerKerberosLoginFile);
303+
}
304+
298305
private void configureValidateMigrationNaming(FluentConfiguration configuration,
299306
boolean validateMigrationNaming) {
300307
try {

‎spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -33,6 +33,8 @@
3333
import org.flywaydb.core.api.callback.Event;
3434
import org.flywaydb.core.api.migration.JavaMigration;
3535
import org.flywaydb.core.internal.license.FlywayTeamsUpgradeRequiredException;
36+
import org.flywaydb.core.internal.plugin.PluginRegister;
37+
import org.flywaydb.database.sqlserver.SQLServerConfigurationExtension;
3638
import org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform;
3739
import org.junit.jupiter.api.Test;
3840
import org.junit.jupiter.api.extension.ExtendWith;
@@ -629,9 +631,15 @@ void outputQueryResultsIsCorrectlyMapped() {
629631

630632
@Test
631633
void sqlServerKerberosLoginFileIsCorrectlyMapped() {
632-
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
633-
.withPropertyValues("spring.flyway.sql-server-kerberos-login-file=/tmp/config")
634-
.run(validateFlywayTeamsPropertyOnly("sqlServer.kerberosLoginFile"));
634+
try {
635+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
636+
.withPropertyValues("spring.flyway.sql-server-kerberos-login-file=/tmp/config")
637+
.run(validateFlywayTeamsPropertyOnly("sqlserver.kerberos.login.file"));
638+
}
639+
finally {
640+
// Reset to default value
641+
PluginRegister.getPlugin(SQLServerConfigurationExtension.class).setKerberosLoginFile(null);
642+
}
635643
}
636644

637645
@Test

‎spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 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.
@@ -110,6 +110,8 @@ void expectedPropertiesAreManaged() {
110110
// Properties specific settings
111111
ignoreProperties(properties, "url", "driverClassName", "user", "password", "enabled", "checkLocation",
112112
"createDataSource");
113+
// Property that moved to a separate SQL plugin
114+
ignoreProperties(properties, "sqlServerKerberosLoginFile");
113115
// High level object we can't set with properties
114116
ignoreProperties(configuration, "callbacks", "classLoader", "dataSource", "javaMigrations",
115117
"javaMigrationClassProvider", "resourceProvider", "resolvers");

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,11 @@ bom {
218218
]
219219
}
220220
}
221-
library("Flyway", "8.0.4") {
221+
library("Flyway", "8.3.0") {
222222
group("org.flywaydb") {
223223
modules = [
224-
"flyway-core"
224+
"flyway-core",
225+
"flyway-sqlserver"
225226
]
226227
plugins = [
227228
"flyway-maven-plugin"

‎src/checkstyle/checkstyle.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
1414
<property name="regexp" value="true" />
1515
<property name="illegalPkgs"
16-
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" />
16+
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.testcontainers\.shaded.*" />
1717
<property name="illegalClasses"
1818
value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^org.springframework.context.annotation.ScannedGenericBeanDefinition, ^reactor\.core\.support\.Assert"/>
1919
</module>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /