cosmo

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

posted on 2019-02-19 16:38  【cosmo】  阅读(1110)  评论(0编辑  收藏  举报