Spring Boot Flyway 自动配置

Spring Boot Flyway AutoConfiguration

嗨,

我正在使用 Spring Boot 1.5.7RELEASE 和 Flyway 4.2.0。 我对文件系统位置的 flyway.locations 属性 配置有问题。

如果我使用 file: 前缀,我有 Flyway 错误:

Caused by: org.flywaydb.core.api.FlywayException: Unknown prefix for location (should be either filesystem: or classpath:):

如果我使用 filesystem: 前缀,我有

Caused by: java.lang.IllegalStateException: Cannot find migrations location in:

我做错了什么? (如果我使用 classpath: 一切正常)

这似乎是 Spring 引导中 FlywayAutoConfiguration 的错误。

解决方法是使用 filesystem: 前缀但禁用位置检查:

spring.flyway.check-location=false # spring boot 2.0.x
flyway.check-location=false        # spring boot 1.5.x

我提出了一个issue and submitted a PR


更新

修复已合并到 Spring Boot 1.5.15 和 2.0.4.