From aa11d6d0fbf8ae814f4ac00ef049453613a35fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 21 Mar 2025 08:49:18 +0100 Subject: [PATCH] Create spring-boot-flyway module --- settings.gradle | 1 + .../build.gradle | 2 +- .../FlywayEndpointAutoConfiguration.java | 4 +- .../FlywayEndpointDocumentationTests.java | 2 +- ...intsAutoConfigurationIntegrationTests.java | 4 +- .../spring-boot-actuator/build.gradle | 2 +- .../actuate/flyway/FlywayEndpointTests.java | 4 +- .../spring-boot-all/build.gradle | 1 - .../main/resources/META-INF/spring.factories | 1 - .../build.gradle | 5 +- .../quartz/QuartzAutoConfiguration.java | 3 +- ...itional-spring-configuration-metadata.json | 154 ----------------- .../main/resources/META-INF/spring.factories | 4 - .../resources/META-INF/spring/aot.factories | 3 - ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../batch/BatchAutoConfigurationTests.java | 2 +- .../IntegrationAutoConfigurationTests.java | 2 +- .../HibernateJpaAutoConfigurationTests.java | 2 +- .../quartz/QuartzAutoConfigurationTests.java | 2 +- .../SessionAutoConfigurationJdbcTests.java | 2 +- .../spring-boot-dependencies/build.gradle | 1 + .../spring-boot-docker-compose/build.gradle | 2 + ...nectionDetailsFactoryIntegrationTests.java | 4 +- ...daptingFlywayConnectionDetailsFactory.java | 4 +- .../spring-boot-docs/build.gradle | 2 + .../spring-boot-flyway/build.gradle | 36 ++++ .../FlywayDatabaseInitializerDetector.java | 2 +- .../FlywayAutoConfiguration.java | 19 +-- .../FlywayConfigurationCustomizer.java | 6 +- .../FlywayConnectionDetails.java | 6 +- .../autoconfigure}/FlywayDataSource.java | 6 +- .../FlywayMigrationInitializer.java | 4 +- ...nitializerDatabaseInitializerDetector.java | 4 +- .../FlywayMigrationStrategy.java | 6 +- .../autoconfigure}/FlywayProperties.java | 4 +- .../FlywaySchemaManagementProvider.java | 4 +- .../NativeImageResourceProvider.java | 4 +- ...NativeImageResourceProviderCustomizer.java | 4 +- .../ResourceProviderCustomizer.java | 4 +- ...ustomizerBeanRegistrationAotProcessor.java | 4 +- .../flyway/autoconfigure}/package-info.java | 4 +- .../boot/flyway/package-info.java | 2 +- .../main/resources/META-INF/spring.factories | 4 + ...itional-spring-configuration-metadata.json | 158 ++++++++++++++++++ .../resources/META-INF/spring/aot.factories | 2 + ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../Flyway100AutoConfigurationTests.java | 4 +- .../FlywayAutoConfigurationTests.java | 48 +----- .../autoconfigure}/FlywayPropertiesTests.java | 4 +- ...eImageResourceProviderCustomizerTests.java | 2 +- ...izerBeanRegistrationAotProcessorTests.java | 4 +- .../build.gradle | 2 + ...re.data.jdbc.AutoConfigureDataJdbc.imports | 2 +- ....data.r2dbc.AutoConfigureDataR2dbc.imports | 2 +- ...toconfigure.jdbc.AutoConfigureJdbc.imports | 2 +- ...toconfigure.jooq.AutoConfigureJooq.imports | 2 +- ...igure.orm.jpa.AutoConfigureDataJpa.imports | 2 +- .../jdbc/DataJdbcTestIntegrationTests.java | 4 +- .../jdbc/JdbcTestIntegrationTests.java | 4 +- .../jooq/JooqTestIntegrationTests.java | 4 +- .../orm/jpa/DataJpaTestIntegrationTests.java | 6 +- .../spring-boot-testcontainers/build.gradle | 3 +- ...ontainerConnectionDetailsFactoryTests.java | 4 +- ...ywayContainerConnectionDetailsFactory.java | 4 +- .../build.gradle | 3 +- .../build.gradle | 2 +- 66 files changed, 306 insertions(+), 300 deletions(-) create mode 100644 spring-boot-project/spring-boot-flyway/build.gradle rename spring-boot-project/{spring-boot-all => spring-boot-flyway}/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayAutoConfiguration.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayConfigurationCustomizer.java (89%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayConnectionDetails.java (94%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayDataSource.java (90%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayMigrationInitializer.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayMigrationInitializerDatabaseInitializerDetector.java (91%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayMigrationStrategy.java (88%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywayProperties.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/FlywaySchemaManagementProvider.java (93%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/NativeImageResourceProvider.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/NativeImageResourceProviderCustomizer.java (93%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/ResourceProviderCustomizer.java (89%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/ResourceProviderCustomizerBeanRegistrationAotProcessor.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure}/package-info.java (84%) rename spring-boot-project/{spring-boot-all => spring-boot-flyway}/src/main/java/org/springframework/boot/flyway/package-info.java (92%) create mode 100644 spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring.factories create mode 100644 spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/additional-spring-configuration-metadata.json create mode 100644 spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/aot.factories create mode 100644 spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure}/Flyway100AutoConfigurationTests.java (94%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure}/FlywayAutoConfigurationTests.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure}/FlywayPropertiesTests.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure}/NativeImageResourceProviderCustomizerTests.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway => spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure}/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java (97%) diff --git a/settings.gradle b/settings.gradle index 4826b37a95..750dcb2d3d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -51,6 +51,7 @@ include "spring-boot-project:spring-boot-dependencies" include "spring-boot-project:spring-boot-devtools" include "spring-boot-project:spring-boot-docker-compose" include "spring-boot-project:spring-boot-docs" +include "spring-boot-project:spring-boot-flyway" include "spring-boot-project:spring-boot-jackson" include "spring-boot-project:spring-boot-jdbc" include "spring-boot-project:spring-boot-jetty" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 2b41b3afed..e70f24fec4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -20,6 +20,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-activemq")) optional(project(":spring-boot-project:spring-boot-amqp")) optional(project(":spring-boot-project:spring-boot-artemis")) + optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jetty")) @@ -94,7 +95,6 @@ dependencies { exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api" } optional("org.elasticsearch.client:elasticsearch-rest-client") - optional("org.flywaydb:flyway-core") optional("org.glassfish.jersey.core:jersey-server") optional("org.glassfish.jersey.containers:jersey-container-servlet-core") optional("org.glassfish.jersey.ext:jersey-micrometer") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointAutoConfiguration.java index 9e11a6907d..af2ec7b312 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointDocumentationTests.java index 79d5f0be30..f945b66837 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/flyway/FlywayEndpointDocumentationTests.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation.MockMvcEndpointDocumentationTests; import org.springframework.boot.actuate.flyway.FlywayEndpoint; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java index babe9873ae..39eb2d42d3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebEndpointsAutoConfigurationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,12 +34,12 @@ import org.springframework.boot.autoconfigure.data.neo4j.Neo4jRepositoriesAutoCo import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration; import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration; import org.springframework.boot.context.annotation.UserConfigurations; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 0a7a79ae5e..7d1c727b2a 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -24,6 +24,7 @@ dependencies { dockerTestImplementation("org.testcontainers:testcontainers") optional(project(":spring-boot-project:spring-boot-activemq")) + optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jetty")) optional(project(":spring-boot-project:spring-boot-jsonb")) @@ -60,7 +61,6 @@ dependencies { exclude(group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api") } optional("org.elasticsearch.client:elasticsearch-rest-client") - optional("org.flywaydb:flyway-core") optional("org.glassfish.jersey.core:jersey-server") optional("org.glassfish.jersey.containers:jersey-container-servlet-core") optional("org.hibernate.validator:hibernate-validator") diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/flyway/FlywayEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/flyway/FlywayEndpointTests.java index 817b102300..123926378f 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/flyway/FlywayEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/flyway/FlywayEndpointTests.java @@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.flyway.FlywayEndpoint.FlywayDescriptor; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; -import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayMigrationStrategy; import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; diff --git a/spring-boot-project/spring-boot-all/build.gradle b/spring-boot-project/spring-boot-all/build.gradle index dbe4bc17aa..631cd5d0cd 100644 --- a/spring-boot-project/spring-boot-all/build.gradle +++ b/spring-boot-project/spring-boot-all/build.gradle @@ -46,7 +46,6 @@ dependencies { optional("org.apache.groovy:groovy-xml") optional("org.crac:crac") optional("org.eclipse.jetty:jetty-client") - optional("org.flywaydb:flyway-core") optional("org.hamcrest:hamcrest-library") optional("org.hibernate.orm:hibernate-core") optional("org.hibernate.validator:hibernate-validator") diff --git a/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories index a250aaadd6..1f0669ce7b 100644 --- a/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories @@ -12,7 +12,6 @@ org.springframework.boot.liquibase.LiquibaseChangelogMissingFailureAnalyzer # Database Initializer Detectors org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\ -org.springframework.boot.flyway.FlywayDatabaseInitializerDetector,\ org.springframework.boot.liquibase.LiquibaseDatabaseInitializerDetector,\ org.springframework.boot.orm.jpa.JpaDatabaseInitializerDetector,\ org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializerDetector diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index 3af801809e..26e3b0c27d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -44,6 +44,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-activemq")) optional(project(":spring-boot-project:spring-boot-artemis")) + optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jsonb")) @@ -115,10 +116,6 @@ dependencies { } optional("org.elasticsearch.client:elasticsearch-rest-client") optional("org.elasticsearch.client:elasticsearch-rest-client-sniffer") - optional("org.flywaydb:flyway-core") - optional("org.flywaydb:flyway-database-postgresql") - optional("org.flywaydb:flyway-database-oracle") - optional("org.flywaydb:flyway-sqlserver") optional("org.freemarker:freemarker") optional("org.glassfish.jersey.containers:jersey-container-servlet-core") optional("org.glassfish.jersey.containers:jersey-container-servlet") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java index 48ac416e62..a54a6055b5 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfiguration.java @@ -33,7 +33,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.autoconfigure.sql.init.OnDatabaseInitializationCondition; @@ -58,7 +57,7 @@ import org.springframework.transaction.PlatformTransactionManager; * @since 2.0.0 */ @AutoConfiguration(after = { DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class, - LiquibaseAutoConfiguration.class, FlywayAutoConfiguration.class }) + LiquibaseAutoConfiguration.class }) @ConditionalOnClass({ Scheduler.class, SchedulerFactoryBean.class, PlatformTransactionManager.class }) @EnableConfigurationProperties(QuartzProperties.class) public class QuartzAutoConfiguration { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json index f9cd4316e0..927c87ad04 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -759,160 +759,6 @@ "reason": "Reactive Elasticsearch client no longer uses WebClient." } }, - { - "name": "spring.flyway.baseline-migration-prefix", - "defaultValue": "B", - "description": "Filename prefix for baseline migrations. Requires Flyway Teams.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 9.0" - } - }, - { - "name": "spring.flyway.check-location", - "type": "java.lang.Boolean", - "deprecation": { - "replacement": "spring.flyway.fail-on-missing-locations", - "level": "error" - } - }, - { - "name": "spring.flyway.cherry-pick", - "description": "Migrations that Flyway should consider when migrating or undoing. When empty all available migrations are considered. Requires Flyway Teams.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 10" - } - },{ - "name": "spring.flyway.community-db-support-enabled", - "defaultValue": false - }, - { - "name": "spring.flyway.dry-run-output", - "type": "java.io.OutputStream", - "deprecation": { - "level": "error", - "reason": "Flyway Teams only." - } - }, - { - "name": "spring.flyway.error-handlers", - "type": "org.flywaydb.core.api.errorhandler.ErrorHandler[]", - "deprecation": { - "level": "error", - "reason": "Flyway Teams only." - } - }, - { - "name": "spring.flyway.ignore-future-migrations", - "type": "java.lang.Boolean", - "description": "Whether to ignore future migrations when reading the schema history table.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 9.0", - "replacement": "spring.flyway.ignore-migration-patterns" - } - }, - { - "name": "spring.flyway.ignore-ignored-migrations", - "type": "java.lang.Boolean", - "description": "Whether to ignore ignored migrations when reading the schema history table.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 9.0", - "replacement": "spring.flyway.ignore-migration-patterns" - } - }, - { - "name": "spring.flyway.ignore-missing-migrations", - "type": "java.lang.Boolean", - "description": "Whether to ignore missing migrations when reading the schema history table.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 9.0", - "replacement": "spring.flyway.ignore-migration-patterns" - } - }, - { - "name": "spring.flyway.ignore-pending-migrations", - "type": "java.lang.Boolean", - "description": "Whether to ignore pending migrations when reading the schema history table.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 9.0", - "replacement": "spring.flyway.ignore-migration-patterns" - } - }, - { - "name": "spring.flyway.license-key", - "description": "License key for Flyway Teams.", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 10" - } - }, - { - "name": "spring.flyway.locations", - "sourceType": "org.springframework.boot.autoconfigure.flyway.FlywayProperties", - "defaultValue": [ - "classpath:db/migration" - ] - }, - { - "name": "spring.flyway.oracle-kerberos-config-file", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.flyway.kerberos-config-file", - "level": "error" - } - }, - { - "name": "spring.flyway.sql-migration-suffix", - "type": "java.lang.String", - "deprecation": { - "replacement": "spring.flyway.sql-migration-suffixes", - "level": "error" - } - }, - { - "name": "spring.flyway.sql-migration-suffixes", - "sourceType": "org.springframework.boot.autoconfigure.flyway.FlywayProperties", - "defaultValue": [ - ".sql" - ] - }, - { - "name": "spring.flyway.undo-sql-migration-prefix", - "type": "java.lang.String", - "deprecation": { - "level": "error", - "reason": "Removed in Flyway 10" - } - }, - { - "name": "spring.flyway.vault-secrets", - "type": "java.util.List", - "deprecation": { - "level": "error", - "reason": "Removed in the open source release of Flyway 7.12." - } - }, - { - "name": "spring.flyway.vault-token", - "type": "java.lang.String", - "deprecation": { - "level": "error", - "reason": "Removed in the open source release of Flyway 7.12." - } - }, - { - "name": "spring.flyway.vault-url", - "type": "java.lang.String", - "deprecation": { - "level": "error", - "reason": "Removed in the open source release of Flyway 7.12." - } - }, { "name": "spring.freemarker.allow-request-override", "description": "Whether HttpServletRequest attributes are allowed to override (hide) controller generated model attributes of the same name. Only supported with Spring MVC." diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories index a95190cb70..43a0dc1575 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring.factories @@ -25,10 +25,6 @@ org.springframework.boot.autoconfigure.mustache.MustacheTemplateAvailabilityProv org.springframework.boot.autoconfigure.thymeleaf.ThymeleafTemplateAvailabilityProvider,\ org.springframework.boot.autoconfigure.web.servlet.JspTemplateAvailabilityProvider -# DataSource Initializer Detectors -org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\ -org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializerDatabaseInitializerDetector - # Depends on Database Initialization Detectors org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitializationDetector=\ org.springframework.boot.autoconfigure.batch.JobRepositoryDependsOnDatabaseInitializationDetector,\ diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/aot.factories b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/aot.factories index cb033c2afa..c32163383f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/aot.factories +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/aot.factories @@ -1,6 +1,3 @@ org.springframework.aot.hint.RuntimeHintsRegistrar=\ org.springframework.boot.autoconfigure.freemarker.FreeMarkerTemplateAvailabilityProvider$FreeMarkerTemplateAvailabilityRuntimeHints,\ org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAvailabilityProvider$GroovyTemplateAvailabilityRuntimeHints - -org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\ -org.springframework.boot.autoconfigure.flyway.ResourceProviderCustomizerBeanRegistrationAotProcessor diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 99ed81cd32..45dc924172 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -36,7 +36,6 @@ org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchClientAutoConfiguration org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration -org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration org.springframework.boot.autoconfigure.graphql.data.GraphQlReactiveQueryByExampleAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 4873607472..329f6ae45e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -60,9 +60,9 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; import org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration.SpringBootBatchConfiguration; import org.springframework.boot.autoconfigure.batch.domain.City; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java index 558b3de265..364ae0cd0d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java @@ -39,7 +39,6 @@ import reactor.core.publisher.Mono; import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.PropertyAccessorFactory; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration.IntegrationComponentScanConfiguration; import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration; import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration; @@ -49,6 +48,7 @@ import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfi import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration; import org.springframework.boot.context.annotation.UserConfigurations; import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java index a542cc53c1..42a1e2389b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java @@ -58,12 +58,12 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfigurationTests.JpaUsingApplicationListenerConfiguration.EventCapturingApplicationListener; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.HibernateRuntimeHints; import org.springframework.boot.autoconfigure.orm.jpa.mapping.NonAnnotatedEntity; import org.springframework.boot.autoconfigure.orm.jpa.test.City; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.XADataSourceAutoConfiguration; import org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java index 86ff2b2080..40ff3b6471 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/quartz/QuartzAutoConfigurationTests.java @@ -45,8 +45,8 @@ import org.quartz.simpl.RAMJobStore; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceProperties; import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java index f0889e8707..1898242cd0 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationJdbcTests.java @@ -26,9 +26,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration; diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 9e44b20e7a..c32c9708cd 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1986,6 +1986,7 @@ bom { "spring-boot-configuration-processor", "spring-boot-devtools", "spring-boot-docker-compose", + "spring-boot-flyway", "spring-boot-jackson", "spring-boot-jarmode-tools", "spring-boot-jdbc", diff --git a/spring-boot-project/spring-boot-docker-compose/build.gradle b/spring-boot-project/spring-boot-docker-compose/build.gradle index bb861cfa81..2d97b85a2d 100644 --- a/spring-boot-project/spring-boot-docker-compose/build.gradle +++ b/spring-boot-project/spring-boot-docker-compose/build.gradle @@ -12,6 +12,7 @@ dependencies { api(project(":spring-boot-project:spring-boot-all")) dockerTestImplementation(project(":spring-boot-project:spring-boot-jdbc")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-flyway")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) dockerTestImplementation("com.hazelcast:hazelcast") dockerTestImplementation("com.redis:testcontainers-redis") @@ -36,6 +37,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-artemis")) optional(project(":spring-boot-project:spring-boot-autoconfigure-all")) optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) + optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional("com.hazelcast:hazelcast") optional("io.r2dbc:r2dbc-spi") diff --git a/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactoryIntegrationTests.java index c2059f3c64..a970136666 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactoryIntegrationTests.java +++ b/spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ package org.springframework.boot.docker.compose.service.connection.flyway; -import org.springframework.boot.autoconfigure.flyway.FlywayConnectionDetails; import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; +import org.springframework.boot.flyway.autoconfigure.FlywayConnectionDetails; import org.springframework.boot.testsupport.container.TestImage; import static org.assertj.core.api.Assertions.assertThat; diff --git a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactory.java b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactory.java index e2c8ce2fef..f564b3cb84 100644 --- a/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/flyway/JdbcAdaptingFlywayConnectionDetailsFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,8 @@ package org.springframework.boot.docker.compose.service.connection.flyway; -import org.springframework.boot.autoconfigure.flyway.FlywayConnectionDetails; import org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory; +import org.springframework.boot.flyway.autoconfigure.FlywayConnectionDetails; import org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails; /** diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 09f1c64037..8d984dfc57 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -66,6 +66,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-autoconfigure", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-autoconfigure-all", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata")) @@ -88,6 +89,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-autoconfigure-all", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jdbc", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata")) diff --git a/spring-boot-project/spring-boot-flyway/build.gradle b/spring-boot-project/spring-boot-flyway/build.gradle new file mode 100644 index 0000000000..1c9a1fa3cf --- /dev/null +++ b/spring-boot-project/spring-boot-flyway/build.gradle @@ -0,0 +1,36 @@ +plugins { + id "java-library" + id "org.springframework.boot.auto-configuration" + id "org.springframework.boot.configuration-properties" + id "org.springframework.boot.deployed" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Flyway" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api(project(":spring-boot-project:spring-boot-jdbc")) + api("org.flywaydb:flyway-core") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional("org.flywaydb:flyway-database-oracle") + optional("org.flywaydb:flyway-database-postgresql") + optional("org.flywaydb:flyway-sqlserver") + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation("jakarta.persistence:jakarta.persistence-api") + testImplementation("org.hibernate.orm:hibernate-core") + testImplementation("org.hsqldb:hsqldb") + testImplementation("org.jooq:jooq") { + exclude group: "javax.xml.bind", module: "jaxb-api" + } + testImplementation("org.postgresql:postgresql") + testImplementation("org.springframework:spring-orm") + + testRuntimeOnly("ch.qos.logback:logback-classic") + testRuntimeOnly("com.h2database:h2") + testRuntimeOnly("com.zaxxer:HikariCP") + testRuntimeOnly("org.flywaydb:flyway-database-hsqldb") +} diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java similarity index 95% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java index 3154578c67..6f23aa24e6 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/FlywayDatabaseInitializerDetector.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java index 137992c374..747bf4deab 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.sql.DatabaseMetaData; import java.time.Duration; @@ -50,20 +50,18 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProp import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.FlywayAutoConfigurationRuntimeHints; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.FlywayDataSourceCondition; -import org.springframework.boot.autoconfigure.flyway.FlywayProperties.Oracle; -import org.springframework.boot.autoconfigure.flyway.FlywayProperties.Postgresql; -import org.springframework.boot.autoconfigure.flyway.FlywayProperties.Sqlserver; -import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.context.properties.ConfigurationPropertiesBinding; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.PropertyMapper; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration.FlywayAutoConfigurationRuntimeHints; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration.FlywayDataSourceCondition; +import org.springframework.boot.flyway.autoconfigure.FlywayProperties.Oracle; +import org.springframework.boot.flyway.autoconfigure.FlywayProperties.Postgresql; +import org.springframework.boot.flyway.autoconfigure.FlywayProperties.Sqlserver; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.DatabaseDriver; import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails; -import org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration; import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; @@ -100,10 +98,9 @@ import org.springframework.util.function.SingletonSupplier; * @author Chris Bono * @author Moritz Halbritter * @author Andy Wilkinson - * @since 1.1.0 + * @since 4.0.0 */ -@AutoConfiguration(after = { DataSourceAutoConfiguration.class, JdbcTemplateAutoConfiguration.class, - HibernateJpaAutoConfiguration.class }) +@AutoConfiguration(after = DataSourceAutoConfiguration.class) @ConditionalOnClass(Flyway.class) @Conditional(FlywayDataSourceCondition.class) @ConditionalOnBooleanProperty(name = "spring.flyway.enabled", matchIfMissing = true) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayConfigurationCustomizer.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayConfigurationCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayConfigurationCustomizer.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayConfigurationCustomizer.java index 65e2adb6c2..eacbef61e8 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayConfigurationCustomizer.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayConfigurationCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import org.flywaydb.core.api.configuration.FluentConfiguration; @@ -23,7 +23,7 @@ import org.flywaydb.core.api.configuration.FluentConfiguration; * configuration. * * @author Stephane Nicoll - * @since 2.1.0 + * @since 4.0.0 */ @FunctionalInterface public interface FlywayConfigurationCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayConnectionDetails.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayConnectionDetails.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayConnectionDetails.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayConnectionDetails.java index 361ca4e5f1..77d3faee92 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayConnectionDetails.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayConnectionDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails; import org.springframework.boot.jdbc.DatabaseDriver; @@ -23,7 +23,7 @@ import org.springframework.boot.jdbc.DatabaseDriver; * Details required for Flyway to establish a connection to an SQL service using JDBC. * * @author Andy Wilkinson - * @since 3.1.0 + * @since 4.0.0 */ public interface FlywayConnectionDetails extends ConnectionDetails { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayDataSource.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayDataSource.java similarity index 90% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayDataSource.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayDataSource.java index 8f07fdeb1e..59b8597e37 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayDataSource.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -29,7 +29,7 @@ import org.springframework.beans.factory.annotation.Qualifier; * data source, the other (main) one would normally be marked as {@code @Primary}. * * @author Dave Syer - * @since 1.1.0 + * @since 4.0.0 */ @Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE, ElementType.ANNOTATION_TYPE }) @Retention(RetentionPolicy.RUNTIME) diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationInitializer.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationInitializer.java index cdd3f1f1d6..f09396930d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializer.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationInitializer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import org.flywaydb.core.Flyway; @@ -27,7 +27,7 @@ import org.springframework.util.Assert; * {@link FlywayMigrationStrategy}. * * @author Phillip Webb - * @since 1.3.0 + * @since 4.0.0 */ public class FlywayMigrationInitializer implements InitializingBean, Ordered { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializerDatabaseInitializerDetector.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationInitializerDatabaseInitializerDetector.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializerDatabaseInitializerDetector.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationInitializerDatabaseInitializerDetector.java index 73690134dc..94db074059 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationInitializerDatabaseInitializerDetector.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationInitializerDatabaseInitializerDetector.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.util.Collections; import java.util.Set; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationStrategy.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationStrategy.java similarity index 88% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationStrategy.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationStrategy.java index ff3edea9c6..67a0aea2c0 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayMigrationStrategy.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayMigrationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import org.flywaydb.core.Flyway; @@ -24,7 +24,7 @@ import org.flywaydb.core.Flyway; * * @author Andreas Ahlenstorf * @author Phillip Webb - * @since 1.3.0 + * @since 4.0.0 */ @FunctionalInterface public interface FlywayMigrationStrategy { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java similarity index 99% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java index e5d8e9ac2a..3ba5d5273f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.io.File; import java.nio.charset.Charset; @@ -38,7 +38,7 @@ import org.springframework.boot.convert.DurationUnit; * @author EddĂș MelĂ©ndez * @author Stephane Nicoll * @author Chris Bono - * @since 1.1.0 + * @since 4.0.0 */ @ConfigurationProperties("spring.flyway") public class FlywayProperties { diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywaySchemaManagementProvider.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywaySchemaManagementProvider.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywaySchemaManagementProvider.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywaySchemaManagementProvider.java index 45300bef41..169d52589c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywaySchemaManagementProvider.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywaySchemaManagementProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.util.stream.StreamSupport; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProvider.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProvider.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProvider.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProvider.java index 88fde2907c..5397941e57 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProvider.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProviderCustomizer.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProviderCustomizer.java index 615a33180c..7df575648c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProviderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.util.Arrays; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizer.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizer.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizer.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizer.java index 21fcdb7aab..5d0d04b79f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizer.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import org.flywaydb.core.api.configuration.FluentConfiguration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizerBeanRegistrationAotProcessor.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessor.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizerBeanRegistrationAotProcessor.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessor.java index 6bdcccecd3..dbe5332836 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizerBeanRegistrationAotProcessor.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import javax.lang.model.element.Modifier; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/package-info.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/package-info.java similarity index 84% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/package-info.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/package-info.java index dea624b424..6a6e4170a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/flyway/package-info.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,4 +17,4 @@ /** * Auto-configuration for Flyway. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/flyway/package-info.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/package-info.java similarity index 92% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/flyway/package-info.java rename to spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/package-info.java index 956b62a6e5..75340bda4f 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/flyway/package-info.java +++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000..50efd0a615 --- /dev/null +++ b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring.factories @@ -0,0 +1,4 @@ +# Database Initializer Detectors +org.springframework.boot.sql.init.dependency.DatabaseInitializerDetector=\ +org.springframework.boot.flyway.FlywayDatabaseInitializerDetector,\ +org.springframework.boot.flyway.autoconfigure.FlywayMigrationInitializerDatabaseInitializerDetector diff --git a/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..5eb6a000b2 --- /dev/null +++ b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/additional-spring-configuration-metadata.json @@ -0,0 +1,158 @@ +{ + "properties": [ + { + "name": "spring.flyway.baseline-migration-prefix", + "defaultValue": "B", + "description": "Filename prefix for baseline migrations. Requires Flyway Teams.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 9.0" + } + }, + { + "name": "spring.flyway.check-location", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.flyway.fail-on-missing-locations", + "level": "error" + } + }, + { + "name": "spring.flyway.cherry-pick", + "description": "Migrations that Flyway should consider when migrating or undoing. When empty all available migrations are considered. Requires Flyway Teams.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 10" + } + },{ + "name": "spring.flyway.community-db-support-enabled", + "defaultValue": false + }, + { + "name": "spring.flyway.dry-run-output", + "type": "java.io.OutputStream", + "deprecation": { + "level": "error", + "reason": "Flyway Teams only." + } + }, + { + "name": "spring.flyway.error-handlers", + "type": "org.flywaydb.core.api.errorhandler.ErrorHandler[]", + "deprecation": { + "level": "error", + "reason": "Flyway Teams only." + } + }, + { + "name": "spring.flyway.ignore-future-migrations", + "type": "java.lang.Boolean", + "description": "Whether to ignore future migrations when reading the schema history table.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 9.0", + "replacement": "spring.flyway.ignore-migration-patterns" + } + }, + { + "name": "spring.flyway.ignore-ignored-migrations", + "type": "java.lang.Boolean", + "description": "Whether to ignore ignored migrations when reading the schema history table.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 9.0", + "replacement": "spring.flyway.ignore-migration-patterns" + } + }, + { + "name": "spring.flyway.ignore-missing-migrations", + "type": "java.lang.Boolean", + "description": "Whether to ignore missing migrations when reading the schema history table.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 9.0", + "replacement": "spring.flyway.ignore-migration-patterns" + } + }, + { + "name": "spring.flyway.ignore-pending-migrations", + "type": "java.lang.Boolean", + "description": "Whether to ignore pending migrations when reading the schema history table.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 9.0", + "replacement": "spring.flyway.ignore-migration-patterns" + } + }, + { + "name": "spring.flyway.license-key", + "description": "License key for Flyway Teams.", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 10" + } + }, + { + "name": "spring.flyway.locations", + "sourceType": "org.springframework.boot.autoconfigure.flyway.FlywayProperties", + "defaultValue": [ + "classpath:db/migration" + ] + }, + { + "name": "spring.flyway.oracle-kerberos-config-file", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.flyway.kerberos-config-file", + "level": "error" + } + }, + { + "name": "spring.flyway.sql-migration-suffix", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.flyway.sql-migration-suffixes", + "level": "error" + } + }, + { + "name": "spring.flyway.sql-migration-suffixes", + "sourceType": "org.springframework.boot.autoconfigure.flyway.FlywayProperties", + "defaultValue": [ + ".sql" + ] + }, + { + "name": "spring.flyway.undo-sql-migration-prefix", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "reason": "Removed in Flyway 10" + } + }, + { + "name": "spring.flyway.vault-secrets", + "type": "java.util.List", + "deprecation": { + "level": "error", + "reason": "Removed in the open source release of Flyway 7.12." + } + }, + { + "name": "spring.flyway.vault-token", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "reason": "Removed in the open source release of Flyway 7.12." + } + }, + { + "name": "spring.flyway.vault-url", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "reason": "Removed in the open source release of Flyway 7.12." + } + } + ] +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/aot.factories b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/aot.factories new file mode 100644 index 0000000000..4f52b20f56 --- /dev/null +++ b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/aot.factories @@ -0,0 +1,2 @@ +org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\ +org.springframework.boot.flyway.autoconfigure.ResourceProviderCustomizerBeanRegistrationAotProcessor diff --git a/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..bec0e6000f --- /dev/null +++ b/spring-boot-project/spring-boot-flyway/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway100AutoConfigurationTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/Flyway100AutoConfigurationTests.java similarity index 94% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway100AutoConfigurationTests.java rename to spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/Flyway100AutoConfigurationTests.java index f7b89c1372..786d186d13 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway100AutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/Flyway100AutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import org.flywaydb.core.Flyway; import org.flywaydb.core.api.Location; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java rename to spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java index 5c1f214518..82e01d1fc7 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.io.Serializable; import java.lang.annotation.ElementType; @@ -61,16 +61,14 @@ import org.springframework.aot.hint.predicate.RuntimeHintsPredicates; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.boot.autoconfigure.AutoConfigurations; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.FlywayAutoConfigurationRuntimeHints; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.OracleFlywayConfigurationCustomizer; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.PostgresqlFlywayConfigurationCustomizer; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration.SqlServerFlywayConfigurationCustomizer; -import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration.FlywayAutoConfigurationRuntimeHints; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration.OracleFlywayConfigurationCustomizer; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration.PostgresqlFlywayConfigurationCustomizer; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration.SqlServerFlywayConfigurationCustomizer; import org.springframework.boot.jdbc.DataSourceBuilder; import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; import org.springframework.boot.jdbc.SchemaManagement; -import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.DataSourceProperties; import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration; import org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails; @@ -492,36 +490,6 @@ class FlywayAutoConfigurationTests { .run((context) -> assertThat(context).hasNotFailed()); } - @Test - @WithMetaInfPersistenceXmlResource - void jpaApplyDdl() { - this.contextRunner - .withConfiguration( - AutoConfigurations.of(DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class)) - .run((context) -> { - Map jpaProperties = context.getBean(LocalContainerEntityManagerFactoryBean.class) - .getJpaPropertyMap(); - assertThat(jpaProperties).doesNotContainKey("hibernate.hbm2ddl.auto"); - }); - } - - @Test - @WithMetaInfPersistenceXmlResource - void jpaAndMultipleDataSourcesApplyDdl() { - this.contextRunner.withConfiguration(AutoConfigurations.of(HibernateJpaAutoConfiguration.class)) - .withUserConfiguration(JpaWithMultipleDataSourcesConfiguration.class) - .run((context) -> { - LocalContainerEntityManagerFactoryBean normalEntityManagerFactoryBean = context - .getBean("&normalEntityManagerFactory", LocalContainerEntityManagerFactoryBean.class); - assertThat(normalEntityManagerFactoryBean.getJpaPropertyMap()).containsEntry("configured", "normal") - .containsEntry("hibernate.hbm2ddl.auto", "create-drop"); - LocalContainerEntityManagerFactoryBean flywayEntityManagerFactoryBean = context - .getBean("&flywayEntityManagerFactory", LocalContainerEntityManagerFactoryBean.class); - assertThat(flywayEntityManagerFactoryBean.getJpaPropertyMap()).containsEntry("configured", "flyway") - .doesNotContainKey("hibernate.hbm2ddl.auto"); - }); - } - @Test void customFlywayWithJdbc() { this.contextRunner @@ -957,9 +925,9 @@ class FlywayAutoConfigurationTests { @Test void overrideLoggers() { this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) - .withPropertyValues("spring.flyway.loggers=log4j2") + .withPropertyValues("spring.flyway.loggers=apache-commons") .run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getLoggers()) - .containsExactly("log4j2")); + .containsExactly("apache-commons")); } @Test @@ -1439,7 +1407,7 @@ class FlywayAutoConfigurationTests { - org.springframework.boot.autoconfigure.flyway.FlywayAutoConfigurationTests$City + org.springframework.boot.flyway.autoconfigure.FlywayAutoConfigurationTests$City true diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java rename to spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java index fbf1528597..6b09452fcd 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java +++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.beans.PropertyDescriptor; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizerTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProviderCustomizerTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizerTests.java rename to spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProviderCustomizerTests.java index 33b474d841..55077919f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizerTests.java +++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/NativeImageResourceProviderCustomizerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.util.Collection; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java rename to spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java index 61f1a0aa11..ac551e3020 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/flyway/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java +++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/ResourceProviderCustomizerBeanRegistrationAotProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.flyway; +package org.springframework.boot.flyway.autoconfigure; import java.util.Arrays; import java.util.function.Consumer; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index 3665c98c7b..2387635d53 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -36,6 +36,7 @@ dependencies { dockerTestRuntimeOnly("io.lettuce:lettuce-core") dockerTestRuntimeOnly("org.springframework.data:spring-data-redis") + optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-jackson")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jsonb")) @@ -125,6 +126,7 @@ dependencies { testImplementation("org.thymeleaf:thymeleaf") testRuntimeOnly(project(":spring-boot-project:spring-boot-tomcat")) + testRuntimeOnly("org.flywaydb:flyway-database-hsqldb") } configurations { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.jdbc.AutoConfigureDataJdbc.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.jdbc.AutoConfigureDataJdbc.imports index adeba77cb0..9826733142 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.jdbc.AutoConfigureDataJdbc.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.jdbc.AutoConfigureDataJdbc.imports @@ -1,6 +1,5 @@ # AutoConfigureDataJdbc auto-configuration imports org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration -org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceInitializationAutoConfiguration @@ -8,4 +7,5 @@ org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConf org.springframework.boot.jdbc.autoconfigure.JdbcClientAutoConfiguration org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration org.springframework.boot.transaction.autoconfigure.TransactionAutoConfiguration +optional:org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.r2dbc.AutoConfigureDataR2dbc.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.r2dbc.AutoConfigureDataR2dbc.imports index 51447aad50..09e8e6033a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.r2dbc.AutoConfigureDataR2dbc.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.r2dbc.AutoConfigureDataR2dbc.imports @@ -1,10 +1,10 @@ # AutoConfigureDataR2dbc auto-configuration imports org.springframework.boot.autoconfigure.data.r2dbc.R2dbcRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.r2dbc.R2dbcDataAutoConfiguration -org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration org.springframework.boot.autoconfigure.r2dbc.R2dbcInitializationAutoConfiguration org.springframework.boot.autoconfigure.r2dbc.R2dbcTransactionManagerAutoConfiguration org.springframework.boot.transaction.autoconfigure.TransactionAutoConfiguration +optional:org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureJdbc.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureJdbc.imports index 2964b6d864..6dd91afa09 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureJdbc.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureJdbc.imports @@ -1,5 +1,4 @@ # AutoConfigureJdbc auto-configuration imports -org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceInitializationAutoConfiguration @@ -7,4 +6,5 @@ org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConf org.springframework.boot.jdbc.autoconfigure.JdbcClientAutoConfiguration org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration org.springframework.boot.transaction.autoconfigure.TransactionAutoConfiguration +optional:org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jooq.AutoConfigureJooq.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jooq.AutoConfigureJooq.imports index 4b3d18b2e0..c2037af930 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jooq.AutoConfigureJooq.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.jooq.AutoConfigureJooq.imports @@ -1,9 +1,9 @@ # AutoConfigureJooq auto-configuration imports -org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceInitializationAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConfiguration org.springframework.boot.transaction.autoconfigure.TransactionAutoConfiguration +optional:org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa.imports index 2cb817f0f6..9311442a49 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa.imports @@ -1,6 +1,5 @@ # AutoConfigureDataJpa auto-configuration imports org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration -org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration @@ -9,4 +8,5 @@ org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerAutoConf org.springframework.boot.jdbc.autoconfigure.JdbcClientAutoConfiguration org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration org.springframework.boot.transaction.autoconfigure.TransactionAutoConfiguration +optional:org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTestIntegrationTests.java index 245b3a72df..72ae14d51c 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/jdbc/DataJdbcTestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.jdbc.core.JdbcTemplate; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestIntegrationTests.java index 44d6fc2ed2..2e34fa6af8 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jdbc/JdbcTestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.jdbc.core.JdbcTemplate; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java index b842c91b0a..2dd2cfc6e2 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/jooq/JooqTestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,8 +25,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.test.autoconfigure.orm.jpa.ExampleComponent; import org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration; import org.springframework.context.ApplicationContext; diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestIntegrationTests.java index f1f84cf1fe..a656cc39a7 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/orm/jpa/DataJpaTestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.data.repository.config.BootstrapMode; @@ -42,7 +42,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor * @author Scott Frederick * @author Yanming Zhou */ -@DataJpaTest +@DataJpaTest(properties = "spring.jpa.hibernate.ddl-auto=create-drop") class DataJpaTestIntegrationTests { @Autowired diff --git a/spring-boot-project/spring-boot-testcontainers/build.gradle b/spring-boot-project/spring-boot-testcontainers/build.gradle index 03e9f6e163..8d444d3c84 100644 --- a/spring-boot-project/spring-boot-testcontainers/build.gradle +++ b/spring-boot-project/spring-boot-testcontainers/build.gradle @@ -13,6 +13,7 @@ dependencies { api(project(":spring-boot-project:spring-boot-autoconfigure-all")) api("org.testcontainers:testcontainers") + dockerTestImplementation(project(":spring-boot-project:spring-boot-flyway")) dockerTestImplementation(project(":spring-boot-project:spring-boot-jdbc")) dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) @@ -28,7 +29,6 @@ dependencies { } dockerTestImplementation("org.assertj:assertj-core") dockerTestImplementation("org.awaitility:awaitility") - dockerTestImplementation("org.flywaydb:flyway-core") dockerTestImplementation("org.junit.jupiter:junit-jupiter") dockerTestImplementation("org.junit.platform:junit-platform-launcher") dockerTestImplementation("org.liquibase:liquibase-core") { @@ -56,6 +56,7 @@ dependencies { optional(project(":spring-boot-project:spring-boot-amqp")) optional(project(":spring-boot-project:spring-boot-artemis")) optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure")) + optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-tx")) optional("org.springframework:spring-test") diff --git a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactoryTests.java index 2a4994eeb3..b382f6a29f 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactoryTests.java +++ b/spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import org.testcontainers.junit.jupiter.Testcontainers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; +import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration; import org.springframework.boot.jdbc.autoconfigure.JdbcConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.boot.testsupport.container.TestImage; diff --git a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactory.java index 94d41ac332..2bc5ee4e29 100644 --- a/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactory.java +++ b/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/flyway/FlywayContainerConnectionDetailsFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ package org.springframework.boot.testcontainers.service.connection.flyway; import org.testcontainers.containers.JdbcDatabaseContainer; -import org.springframework.boot.autoconfigure.flyway.FlywayConnectionDetails; +import org.springframework.boot.flyway.autoconfigure.FlywayConnectionDetails; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory; import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource; import org.springframework.boot.testcontainers.service.connection.ServiceConnection; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc-flyway/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc-flyway/build.gradle index 960ef7625d..d9b0cf47b3 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc-flyway/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc-flyway/build.gradle @@ -16,8 +16,7 @@ dependencies { implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-r2dbc")) - runtimeOnly(project(":spring-boot-project:spring-boot-jdbc")) - runtimeOnly("org.flywaydb:flyway-core") + runtimeOnly(project(":spring-boot-project:spring-boot-flyway")) runtimeOnly("org.flywaydb:flyway-database-postgresql") runtimeOnly("org.postgresql:postgresql") runtimeOnly("org.postgresql:r2dbc-postgresql") diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle index 516b53f0c8..098d9c1e1b 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-flyway/build.gradle @@ -9,8 +9,8 @@ dependencies { implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-jpa")) implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) + runtimeOnly(project(":spring-boot-project:spring-boot-flyway")) runtimeOnly("com.h2database:h2") - runtimeOnly("org.flywaydb:flyway-core") testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) }