Skip to content

Flyway Java migration not supported in native images #33458

Closed as not planned
Closed as not planned
@bclozel

Description

@bclozel

As discussed on gitter with @jnizet :

Hi team. I was just experimenting with native image support with a small application I have, and I think I found a missing piece in the native support. Flyway migrations are correctly detected and run... except the Java migrations. I get the following warning from Flyway at startup:

WARN 1 --- [ main] o.f.core.internal.command.DbMigrate : Schema "public" has a version (011) that is newer than the latest available migration (010) !

And the reason is that the migration 011, which has been run by a previous run of the application (in "non-native" mode), is a Java migration rather than a more traditional SQL migration (https://flywaydb.org/documentation/tutorials/java)

While we support the discovery of static sql migration files at runtime in a native image (using a custom resolver, org.springframework.boot.autoconfigure.flyway.NativeImageResourceProviderCustomizer) we are currently missing reflection metadata entries for the Java migration classes, since they are instantiated reflectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: declinedA suggestion or change that we don't feel we should currently applytheme: aotAn issue related to Ahead-of-time processingtype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions