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
Spring Jdbc not available from command line #783
Comments
I've also tried adding the spring-core, spring-tx jars into jars with no luck |
So, I found a way to make it work, but it requires modification of the classpath in the "flyway" shell script, which seems dubious, and also requires the inclusion of FIVE dependencies, without which I either get the behavior described in the issue, or a ClassNotFoundException. Specifically, I need to add the following libraries: And change https://github.com/flyway/flyway/blob/flyway-3.0/flyway-commandline/src/main/assembly/flyway#L52 to
or in 4.0, https://github.com/flyway/flyway/blob/master/flyway-commandline/src/main/assembly/flyway#L57 to
Is there a smarter way to do this? Is this documented anywhere? |
Thanks for the report. Flyway will automatically load all jar files in the /jars directory. Did you try simply placing all 5 jar files there? |
It looks like it's trying to load all the jars, but I get a NoClassDefFoundError when I don't modify the classpath in the script: Without modifying classpath:
After modifying the classpath:
EDIT: Added shell script debug output. |
This issue has resurfaced in at least version 5.2.4. |
…th, same as in issue flyway#783
I have detailed this issue in a question on StackOverflow, but it appears to be a bug, instead of a configuration issue, as best as I can see.
In short, I have a jar file with two java migrations in the same package. One implements JdbcMigration, and one implements SpringJdbcMigration. The former is picked up by the command line migrate command, the latter is not.
When running with debug mode, it shows "Spring Jdbc available: false" despite it also showing the spring-jdbc jar being added to the classpath just a few lines above.
Below, see the output from debug, copied from my StackOverflow question, and with a few notes added:
This same file is parsed fine when running Flyway within my application, but our process depends on running it externally, which likely means command line.
If this is a configuration issue on my end, or a bug, please let me know.
The text was updated successfully, but these errors were encountered: