Spring-boot自动导入applicationContext.xml?

mem*_*und 30 java spring spring-boot

我正在使用spring-boot并想自动导入src/main/resources/applicationContext.xml文件.

到目前为止它只有在我明确告诉spring导入它时才有效:

@EnableAutoConfiguration
@Configuration
@ImportResource({"classpath*:applicationContext.xml"})
Run Code Online (Sandbox Code Playgroud)

但是spring-boot有很多默认值,也许有人知道app.xml文件的"默认"名称,所以默认情况下它会被spring-boot选中?

geo*_*and 22

默认情况下,根据其名称或位置导入XML配置没有此功能.

查看文档的这一部分.