Closed vladimirfx closed 2 years ago
This is a known limitation of native-image. Classpath resources can't be enumerated in a native-image, see https://github.com/oracle/graal/issues/1108.
For Spring Boot 3, we have to see how Flyway can be supported. One idea is to enumerate the files at build time, create an index file, and use that index file when loading flyway migrations on native image runtime.
For Spring Boot 3, we have to see how Flyway can be supported. One idea is to enumerate the files at build time, create an index file, and use that index file when loading flyway migrations on native image runtime.
I can file the PR with similar approach to R2DBC migration. Is there any ticket for Flyway to subscribe on?
Yes, this one: https://github.com/spring-projects/spring-boot/issues/31999
Resources are correctly included in the image and direct paths like
classpath:db/migration/V1__initial.sql
work as expected.Usage code: https://github.com/nkonev/r2dbc-migrate/blob/master/r2dbc-migrate-resource-reader-spring/src/main/java/name/nkonev/r2dbc/migrate/reader/SpringResourceReader.java