Olá, após a adição do flyway ao projeto e criação das migrations, comecei o erro abaixo ao rodar o projeto. Tentei especificar o diretório no application.yml usando a chave flyway.locations.classpath: /db/migration
dentro da chave spring
. Mas não adiantou.
Alguém sabe como resolver esse erro?
....
2022-05-09 18:55:27.516 WARN 2772 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.flywaydb.core.Flyway]: Factory method 'flyway' threw exception; nested exception is org.springframework.boot.autoconfigure.flyway.FlywayMigrationScriptMissingException: Cannot find migration scripts in: [classpath:db/migration] (please add migration scripts or check your Flyway configuration)
2022-05-09 18:55:27.517 INFO 2772 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2022-05-09 18:55:27.524 INFO 2772 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2022-05-09 18:55:27.529 INFO 2772 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-05-09 18:55:27.553 INFO 2772 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-05-09 18:55:27.627 ERROR 2772 --- [ 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
Process finished with exit code 0
Ps.: A versão do flyway que estou utlizando é a 7.10.0. Já testei com a 8.5.10 (a mais atual no momento que criei o post) e deu o mesmo erro.