简体   繁体   中英

Why does liquibaseAutoConfiguration register a depenency with entityManagerFactory

The new version of spring-boot and liquibaseAutoConfiguration we just upgraded to is causing us some issues, it fails because it is looking for a non-existent liquibase file to load, we have done out liquibase configuration using our own self written runners in the past that use a different structure.

Anyways, there are a few potential fixes, one of which is to simply disable the liquibaseAutoConfiguration class from running. I don't believe we need the bean, but I'm a little uncertain about the reason for adding a dependency to entityManager, which makes me wonder if it's doing something we do need. Here is a link to the source

I'm trying to understand why the LiquibaseJpaDependencyConfiguration class exists. Why does the entityManagerFactory need to depend on the liquibase bean? I would think that the entityManager would be unaware of liquibase?

The entity manager factory doesn't care about Liquibase specifically, but it does care that the database has been fully initialized. The dependency that's setup by LiquibaseJpaDependencyConfiguration ensures that is the case as it forces Liquibase to run before the entity manager factory is created.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM