I am defining my own Liquibase auto configuration to manage multitenancy, which involves a prototype SpringLiquibase
bean:
@Bean
@Scope(value = BeanDefinition.SCOPE_PROTOTYPE)
SpringLiquibase tenantCreatedLiquibase(String tenantId) {
// construct a SpringLiquibase instance
}
The tenantCreatedLiquibase
prototype bean is instantiated at runtime via an ObjectProvider<SpringLiquibase>
.
But LiquibaseDatabaseInitializerDetector
creates a dependency from jdbcTemplate
on my tenantCreatedLiquibase
bean. The ApplicationContext fails to load because the tenantCreatedLiquibase
prototype bean requires a tenantId
argument.
How can I disable the LiquibaseDatabaseInitializerDetector
? Or otherwise work around this problem?