【发布时间】:2018-08-03 15:22:30
【问题描述】:
我有一个 Spring Boot 项目,其中 Flyway 与 JPA 一起使用。
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
项目运行良好。由于某些要求,我不得不更改 Flyway 加载的顺序,因此它在 Hibernate 之后加载。我搜索并找到了以下解决方案https://stackoverflow.com/a/44806540/1361888。我按照上面链接中的答案建议创建了MigrationConfiguration。现在,当我运行应用程序时,它会给我以下错误,
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method flywayInitializer in
com.x2iq.microservice.config.MigrationConfiguration required a bean of type
'org.flywaydb.core.Flyway' that could not be found.
Action:
Consider defining a bean of type 'org.flywaydb.core.Flyway' in your
configuration.
现在我对 Spring Boot 还很陌生,所以无法理解这个错误,我在网上找不到与这个错误相关的任何内容。
【问题讨论】:
标签: java spring hibernate spring-boot flyway