问题描述
将Flyway从5.2.4升级到
compile group: 'org.flywaydb',name: 'flyway-core',version: '6.5.0'
并运行spring boot应用程序时出现错误:
Unsatisfied dependency expressed through method 'mapDao' parameter 0;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration':
Unexpected exception during bean creation;
nested exception is java.lang.TypeNotPresentException:
Type org.flywaydb.core.api.callback.FlywayCallback not present
Flyway upgrade recommended: Postgresql 12.3 is newer than this version of Flyway and support has not been tested.
我想解决的问题
我应该如何配置应用程序,使其使用Flyway 6.5和Spring Boot 2.1.2RELEASE?
解决方法
org.flywaydb.core.api.callback.FlywayCallback
界面在2018年被org.flywaydb.core.api.callback.Callback
取代,因此只需更新代码即可使用新界面。
它并不能真正回答问题,但是在我的情况下是可以接受的。 我刚刚将Spring Boot依赖关系更新为2.2.2,该错误已消失。 无需更改应用程序源代码。