FlywayException: Unable to scan for SQL migrations in location: classpath:db/migration FlywayException: Unable to scan for SQL migrations in location: classpath:db/migration database database

FlywayException: Unable to scan for SQL migrations in location: classpath:db/migration


This also happens if the compile goal is not executed before calling flyway:migrate. Actually this IS included in the quick start manual. It says:

mvn compile flyway:migrate

However if you miss that detail and start to just call mvn flyway:migrate, the SQL file will not get copied into the target directory (actually the target directory will not even exist) and you get this cryptic error.


Well, just for you to know.

I found the problem, it happens when we setup flyway in our environment but we don't have any migration to be executed.

It shouldn't display a classpath error but fortunately it's working.

By the way, another problem I found is that after executing init if we check with info nothing is displayed. And if we add a new migration with V1 then info won't show it unless we change it to V1_1

Hope to help


I had a similar problem and it was because when I created the migration directory I gave it the name db.migration directly.

By creating the directory db and then inside it the migration directory it worked.