Spring Boot 1.5.11、Flyway 5.0.7(5.1.1も試してみました)。場所の指定は無視されます。ここで何が欠けていますか?
spring:
profiles: db_h2
datasource:settings
platform: h2
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:log4jdbc:h2:mem:TEST;DB_CLOSE_ON_EXIT=FALSE
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
hikari:
maximum-pool-size: 5
driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jpa:
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
flyway:
locations: classpath:/flyway/h2,classpath:/flyway/common,classpath:/flyway/testdata
h2:
console:
enabled: true
path: /h2
ログの抜粋は、適切なプロファイルが取得されていることを示していますが、指定された設定は次のとおりではありません。
2018-06-05 08:24:48.282 DEBUG 13188 --- [ main] c.c.c.backend.config.Application : Running with Spring Boot v1.5.11.RELEASE, Spring v5.0.5.RELEASE
2018-06-05 08:24:48.282 INFO 13188 --- [ main] c.c.c.backend.config.Application : The following profiles are active: db_h2,logging_normal,http_insecure,credentials_insecure,option_create_sql_script
2018-06-05 08:24:52.240 INFO 13188 --- [ main] o.f.core.internal.util.VersionPrinter : Flyway Community Edition 5.0.7 by Boxfuse
2018-06-05 08:24:52.414 INFO 13188 --- [ main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:h2:mem:TEST (H2 1.4)
2018-06-05 08:24:52.431 DEBUG 13188 --- [ main] jdbc.sqltiming : com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.Java:52)
1. CALL SCHEMA()
{executed in 5 msec}
2018-06-05 08:24:52.445 DEBUG 13188 --- [ main] org.flywaydb.core.Flyway : DDL Transactions Supported: false
2018-06-05 08:24:52.447 DEBUG 13188 --- [ main] org.flywaydb.core.Flyway : Schema: PUBLIC
2018-06-05 08:24:52.452 DEBUG 13188 --- [ main] o.f.core.internal.util.FeatureDetector : Spring Jdbc available: true
2018-06-05 08:24:52.454 DEBUG 13188 --- [ main] o.f.c.i.c.SqlScriptFlywayCallback : Scanning for SQL callbacks ...
2018-06-05 08:24:52.455 DEBUG 13188 --- [ main] o.f.c.i.u.s.classpath.ClassPathScanner : Scanning for classpath resources at 'classpath:db/migration' (Prefix: '', Suffixes: '.sql')
2018-06-05 08:24:52.455 DEBUG 13188 --- [ main] o.f.c.i.u.s.classpath.ClassPathScanner : Determining location urls for classpath:db/migration using ClassLoader Sun.misc.Launcher$AppClassLoader@18b4aac2 ...
2018-06-05 08:24:52.506 WARN 13188 --- [ main] o.f.c.i.u.s.classpath.ClassPathScanner : Unable to resolve location classpath:db/migration
Spring Boot 1.5のドキュメント から正しいプロパティ名はflyway.locations
、spring
プレフィックスなし。 1.5ブランチと2.0ブランチでは異なります。