Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

PathMatchingResourcePatternResolver failed to find resources by mask like classpath:/db/migration/*.sql #1681

Closed
vladimirfx opened this issue Aug 5, 2022 · 4 comments
Labels
for: external-project For an external project and not something we can fix

Comments

@vladimirfx
Copy link

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 5, 2022
@mhalbritter
Copy link
Contributor

This is a known limitation of native-image. Classpath resources can't be enumerated in a native-image, see oracle/graal#1108.

@mhalbritter mhalbritter added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Aug 9, 2022
@mhalbritter
Copy link
Contributor

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.

@mhalbritter mhalbritter closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2022
@vladimirfx
Copy link
Author

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?

@mhalbritter
Copy link
Contributor

Yes, this one: spring-projects/spring-boot#31999

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
for: external-project For an external project and not something we can fix
Development

No branches or pull requests

3 participants