gluonhq / substrate

Create native Java(FX) apps for desktop, mobile and embedded
GNU General Public License v2.0
372 stars 51 forks source link

How to get absolute path of resources dir in GrallVM native-image, e.g. src/main/resources/db/migrations #1247

Open ctoabidmaqbool opened 2 months ago

ctoabidmaqbool commented 2 months ago

I am instrusted to use FlywayDb works anyway with Gluon Gradle Plugins / Gluon Maven Plugin e.g. GrallVM native-image feature.

https://github.com/flyway/flyway/issues/2927

As the trick provided by @Khithar workd like a charm e.g. Flyway.configure().locations("filesystem:" TEMPDIR) but TEMPDIR in this case must be absolute and relatevie system path e.g. C:\db\migrations' or/db/migrations`.

How can I get absoute path from my code that must works correctly in grallvm-native image too e.g. src/main/resources/db/migrations.

In short how can i get absolute path of migrations dir automatically?

For testing project, let see the comment message: https://github.com/flyway/flyway/issues/2927#issuecomment-2058477332

Its works with .SQL migrations files, Flyway.configure().locations("filesystem:", "C:\db\migration");

@johanvos @jperedadnr