Spring multiple @Configuration classes

后端 未结 3 909
后悔当初
后悔当初 2021-02-01 21:54

I am using Spring @Configuration annotation to configure my application.

Currently, I have a single @Configuration class where all my beans are

3条回答
  •  一个人的身影
    2021-02-01 22:00

    @Configuration
    @Import({ DataSourceConfig.class, TransactionConfig.class })
    public class AppConfig extends ConfigurationSupport {
          // bean definitions here can reference bean definitions in DataSourceConfig or TransactionConfig
    }
    

提交回复
热议问题