diff --git a/settings.gradle b/settings.gradle index 4826b37a955..750dcb2d3d1 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 0611db116b4..b5163f4d426 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")) @@ -101,7 +102,6 @@ dependencies { optional("org.elasticsearch.client:elasticsearch-rest-client") { exclude group: "commons-logging", module: "commons-logging" } - 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 9e11a6907d8..af2ec7b3124 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 79d5f0be30a..f945b66837f 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 babe9873ae2..39eb2d42d34 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 943e147d98a..bc28893529d 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")) @@ -62,7 +63,6 @@ dependencies { optional("org.elasticsearch.client:elasticsearch-rest-client") { exclude(group: "commons-logging", module: "commons-logging") } - 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 817b102300e..123926378f8 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 dbe4bc17aa3..631cd5d0cdc 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 a250aaadd6f..1f0669ce7bd 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 e569d072bc2..e66139f4342 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")) @@ -126,10 +127,6 @@ dependencies { optional("org.elasticsearch.client:elasticsearch-rest-client-sniffer") { exclude group: "commons-logging", module: "commons-logging" } - 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 48ac416e62f..a54a6055b57 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 fc1c595c79d..2496ec5ef60 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 a95190cb706..43a0dc1575b 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 cb033c2afac..c32163383f3 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 4c575e906c5..04dc1cd2bf4 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 94ee61b35f4..6dc7a674843 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 558b3de2655..364ae0cd0d0 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 fea3763c788..022aa3ac54a 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 86ff2b2080b..40ff3b64711 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 f0889e87074..1898242cd05 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 ad851035b23..b63ae600270 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -2024,6 +2024,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 bb861cfa81a..2d97b85a2d9 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 c2059f3c643..a9701366664 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 e2c8ce2fefa..f564b3cb847 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 d8552db2251..b96cae7d49e 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -60,6 +60,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")) @@ -82,6 +83,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 00000000000..7008917314b --- /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") +} \ No newline at end of file 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 3154578c673..6f23aa24e6c 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 68d1b5fb225..c44d0c9d1ca 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 65e2adb6c28..eacbef61e85 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 361ca4e5f18..77d3faee92c 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 8f07fdeb1e2..59b8597e370 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 cdd3f1f1d62..f09396930d3 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 73690134dc8..94db0740597 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 ff3edea9c62..67a0aea2c09 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 e5d8e9ac2ab..3ba5d5273f7 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 45300bef41b..169d52589c7 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 88fde2907c1..5397941e578 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 615a33180cd..7df575648cd 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 21fcdb7aabc..5d0d04b79fa 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 6bdcccecd37..dbe53328366 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 dea624b4247..6a6e4170a49 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 956b62a6e5c..75340bda4f5 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 00000000000..50efd0a6158 --- /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 00000000000..5eb6a000b2b --- /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 00000000000..4f52b20f568 --- /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 00000000000..bec0e6000fe --- /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 f7b89c13722..786d186d134 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 5c1f2145185..82e01d1fc7f 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 fbf15285972..6b09452fcd7 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 33b474d8414..55077919f2a 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 61f1a0aa110..ac551e30207 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 d4da77b01bf..97e72e4b063 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")) @@ -119,6 +120,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 adeba77cb0b..98267331421 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 51447aad504..09e8e6033aa 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 2964b6d864c..6dd91afa09d 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 4b3d18b2e0b..c2037af9300 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 2cb817f0f63..9311442a492 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 245b3a72dfa..72ae14d51ce 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 44d6fc2ed24..2e34fa6af8a 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 b842c91b0ac..2dd2cfc6e26 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 f1f84cf1fe8..a656cc39a77 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 0b0e9bdf518..53ae61d5920 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")) @@ -32,7 +33,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") { @@ -60,6 +60,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 2a4994eeb38..b382f6a29f6 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 94d41ac3322..2bc5ee4e299 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 960ef7625d0..d9b0cf47b3d 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 516b53f0c87..098d9c1e1bd 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")) }