-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
classpath scanner does not find db.migration package or resources #1261
Comments
Thanks for reporting. Please post a GitHub repo to reproduce this. |
Hi. You can find an example here https://github.com/pabl0rg/kobalt-mixed-example/ Steps:
|
Hello, has anyone been able to run the example project to reproduce the error? In another project, i've used this library which does a good job of scanning inside jars. |
Hello this is still marked as waiting for feedback but i provided the feedback and an example almost three months ago. Has anyone been able to check out the example? thanks! |
I observe a similar problem. I work on a java application with an in memory database. Flyway finds only the migration sql scripts in the filesystem or in the classpath of the application startet from eclipse. If the application is packaged into jars with the sql files included, flyway don't find them. As a workaround I copy the sql scripts from the jar to a temporary folder in the filesystem and all it fine. There seems a bug in the loading from the classpath from jar files. (I use version 4.0.3) |
Would you be interested in sharing the cost of sponsoring this fix? |
Same problem here, only works by filesystem. |
My company has sponsored a fix for this and the last snapshot we got is working. So, hold tight for the next release which will finally have this fixed. |
@pabl0rg Just out of curiosity, what is the structure of your jar like? I just had a similar problem with a Spring Boot app, turned out to be because Spring Boot structures its fat jars in a non-standard way. |
The jar was a standard maven jar. The jar could have been modified to work with flyway but the flyway guys actually found there was a slight issue in how they were searching the classpath. They haven't released a new flyway due to lack of time, but they have this fixed in git. |
@pabl0rg Thanks again for sponsoring. Fixed. |
Hi, Thanks |
I'm intermittently seeing - what looks to be - this issue with |
Hi, have this issue been actually fixed? In what release in that case? |
It seems like they haven't fixed the issue. I'm recently using Flyway v6.5.7 and is still happening, Flyway can't find the migrations inside the Spring Boot JAR.. Maybe it doesn't recognize the way Maven packs Spring Boot binary, mine are located in the route path BOOT-INF/classes/db/migration inside the JAR.. |
Cheers @pabl0rg what is your take on this? Best regards |
Well, finally I found a workaround.. I simply put: And Flyway was able to find and execute the migrations. Hope this can help somebody else.. Cheers.. |
In my case, the migration scripts are within another jar file within the main jar file. How can I set the location in such a case? |
What version of Flyway are you using?
4.0
What operating system are you using?
MacOS
What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
If i run the following (kotlin) class from a jar file (the db.migration package & resources are part of the same jar):
I get the following, confusing log messages:
The messages are very confusing because first there's a WARN saying the location of db/migration could not be found, and later an INFO message saying 2 migrations were validated. Either way, no migrations run.
If i unzip the jar file and then run the same class, the log messages are different and the migrations actually get run
The text was updated successfully, but these errors were encountered: