I need to execute Flyway migration after Hibernate generates all the schema table. Before migrating to Spring Boot 2.2 this code worked fine
@Configuration
public class BaseFlywayConfiguration {
/**
* Override default flyway initializer to do nothing
*/
@Bean
FlywayMigrationInitializer flywayInitializer(Flyway flyway) {
return new FlywayMigrationInitializer(flyway, (f) -> {
});
}
/**
* Create a second flyway initializer to run after jpa has created the schema
*/
@Bean
@DependsOn("transactionManager")
FlywayMigrationInitializer delayedFlywayInitializer(Flyway flyway) {
return new FlywayMigrationInitializer(flyway, null);
}
}
Unfortunately after migrating to Spring Boot 2.2.0 I receive an Exception related to a circular dependency
This is the log:
The dependencies of some of the beans in the application context form a cycle:
┌─────┐ | transactionManager defined in class path resource [com/myFleetSolutions/myFleet/organization/configuration/jpa/JPAConfigurationDev.class] └─────┘
How can I solve it?