Search code examples
databasepostgresqljpamigrationflyway

Flyway failed to initialize. Doesn't see files


I have error:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-02-11 19:25:22.908 ERROR 8116 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Flyway failed to initialize: none of the following migration scripts locations could be found:

    - classpath:db/migration


Action:

Review the locations above or check your Flyway configuration

But the folder and files with scripts exist!

enter image description here

Also:

Appication.properties

spring.jpa.generate-ddl=true
spring.jpa.show-sql=false
spring.jpa.hibernate.ddl-auto=validate

Why doesn't Flyway see the files?


Solution

  • Something is not right. Based on the image icon your folder is a package, not a resource folder. Maybe your directory name is db.migration not db/migration? Create the folder again using terminal or file manager.