1.spring boot配置disconf需要在启动类上配置读取xml的入口注解:@ImportResource({"classpath:spring-disconf.xml"})
package com.zpark;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling; /**
* @author cosmo
* @Title: SptingbootApplication
* @ProjectName
* @Description: Sptingboot启动类
* @date 2019/1/2211:11
*/
@SpringBootApplication
@EnableScheduling
@ImportResource({"classpath:spring-disconf.xml"})
public class SptingbootApplication {
public static void main(String[] args) {
SpringApplication.run(PacificServiceApplication.class, args);
}
}
剩下的跟spring集成disconf的步骤都是一样的,详情参见:Spring MVC 集成Disconf