Flyway should not expect "org/flywaydb/core/internal/version.txt" to be on the custom classpath #1023
Comments
What OSGi container are you using? Our tests pass just fine in Equinox. Cheers |
I am currently running in Eclipse, but I believe this issue would happen in any OSGi container. If I do something as simple as
Then Flyway will always fail because of existing:
This is because Flyway is expecting "org/flywaydb/core/internal/version.txt" to exist within the custom ClassLoader. If I instead have Flyway use its own ClassLoader, then of course Flyway can find "org/flywaydb/core/internal/version.txt" within the Flyway JAR, but it will never find my SQL scripts in a different bundle. |
Thanks for investigating. That was incredibly helpful. Consider this fixed in time for the next release. Cheers |
FWIW I am having the same issue running in Felix. Is there a workaround or a recommended alternate approach? |
Same issue in Felix |
I'm using Felix. Has a work-around been discovered yet? |
For now, it would seem that your SQL migrations must be in the same bundle as Flyway (stored in a fragment hosted by org.flywaydb.core, for example). |
Thank you. |
Fixed. |
Could you please release this fix in version 3? |
If I try to run Flyway 3.2.1 in OSGi and set a different ClassLoader into Flyway, then flyway.migrate() will fail immediately because VersionPrinter requires that an "org/flywaydb/core/internal/version.txt" exists.
The text was updated successfully, but these errors were encountered: