diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index 2d712213b5..dc7d5d75cb 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.data.jpa.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -52,7 +53,8 @@ import org.springframework.util.Assert; @ConditionalOnClass(Flyway.class) @ConditionalOnBean(DataSource.class) @ConditionalOnProperty(prefix = "flyway", name = "enabled", matchIfMissing = true) -@AutoConfigureAfter(DataSourceAutoConfiguration.class) +@AutoConfigureAfter({ DataSourceAutoConfiguration.class, + HibernateJpaAutoConfiguration.class }) public class FlywayAutoConfiguration { @Configuration diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java index 0e24e73962..d37bbb6743 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java @@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.data.jpa.EntityManagerFactoryDependsOnPostProcessor; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.liquibase.CommonsLoggingLiquibaseLogger; import org.springframework.context.annotation.Bean; @@ -57,7 +58,8 @@ import org.springframework.util.Assert; @ConditionalOnClass(SpringLiquibase.class) @ConditionalOnBean(DataSource.class) @ConditionalOnProperty(prefix = "liquibase", name = "enabled", matchIfMissing = true) -@AutoConfigureAfter(DataSourceAutoConfiguration.class) +@AutoConfigureAfter({ DataSourceAutoConfiguration.class, + HibernateJpaAutoConfiguration.class }) public class LiquibaseAutoConfiguration { @Configuration