Is it possible to disable an autoconfiguration class from another autoconfiguration class in spring boot?

后端 未结 2 2206
后悔当初
后悔当初 2021-02-15 12:22

I\'m working on a data access library and would like to be able to include it as a dependency in other projects with minimal configuration (ideally just autowire a repo). In par

2条回答
  •  日久生厌
    2021-02-15 13:12

    you can exclude then via

    @SpringBootApplication(exclude= {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class}))

    but you could exclude them in your @Configuration by adding @EnableAutoConfiguration(exclude= {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})

提交回复
热议问题