springboot使用过程中踩过的坑

  1. SpringBoot项目启动过程中出现类似Could not resolve placeholder ‘td.pathprefix’ in value “${td.pathprefix}”的错误。
      问题的产生是由于有多个properties文件造成的,如果再第一个properties文件中没有找,就不认为没有了,不继续找下一个properties文件
    1
    2
    3
    4
    5
    6
    @Bean
    public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
    PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
    c.setIgnoreUnresolvablePlaceholders(true);
    return c;
    }
  2. 项目中用到什么依赖加载什么依赖,不要一股脑都添加上去,springboot会做各种初始设置,可能引起报错