Execute a flyway callback in command line

Viewed 902

I use flyway command-line in a docker container to apply my migration scripts. I now have to add a Java callback in my implementation. The callback can successfully be detected and launch through the flyway-maven-plugin, with a <callback> definition in the pom.xml. I generate a JAR of this project.

I now want to run it with the command line. The following command works, my SQL migrations are applied

flyway repair migrate 
    -locations=path/to/sql/migration
    -url=...

If I add my callback, in this way, it tells me the following error

flyway repair migrate 
    -locations=path/to/sql/migration 
    -callbacks=com.company.MyCallback
    -url=...

Unable to instantiate class "com.company.MyCallback"

I also tried the jarDirs option, but same error

flyway repair migrate 
    -locations=path/to/sql/migration 
    -jarDirs=/folder/containing/the/jar/i/generated
    -callbacks=com.company.MyCallback
    -url=...

But no result. Any help or hint will be appreciated!

1 Answers
Related