如果必须使用XML配置,建议你仍旧从一个@Configuration类开始,然后使用@ImportResource注解加载XML配置文件。
@Configuration
@ImportResource
@Configuration @Import(CDPlayerConfig.class) @ImportResource("classpath:cons-injec.xml") //导入xml配置项 public class SoundSystemConfig { }