自 spring boot 2.4.1 以来,spring.data.jpa.repositories.bootstrap-mode 已恢复为默认值。我想启用 spring.data.jpa.repositories.bootstrap-mode=deferred 但它被忽略(日志显示默认)
但是,如果我不设置 application.propety,而是使用 @EnableJpaRepositories("com.rebirthCorp.rebirth.repositories", bootstrapMode = BootstrapMode.DEFERRED) 设置它,则可以正确启用它。注意:这可能会帮助您找到错误的根本原因:
Multiple Spring Data modules found, entering strict repository configuration mode!
@SpringBootApplication
@EnableIntegration
@EnableJpaRepositories("com.rebirthCorp.rebirth.repositories", bootstrapMode = BootstrapMode.DEFERRED)
@EnableElasticsearchRepositories("com.rebirthCorp.rebirth.elasticrepositories")
class RebirthApplication