IntellJ IDEA 对于 Spring Boot2.0.2 配置文件application.properties 配置

1、指定文件名称: 

     打开IDEA编辑位置:

                     

    找到如图位置:

                     

             点开后方设置

                   

扫描二维码关注公众号,回复: 946277 查看本文章

           设置输入如下内容:(默认的配置文件名字可以使用--spring.config.name来指定,只需要指定文件的名字,文件扩展名可以省略,注意中间或两边不要有空格

                   

2、指定文件路径:

            流程如上,修改内容如下:

                                --spring.config.location=classpath:config/app.properties

            文件位置:

                          

3、指定多个配置文件(不在项目路径下)

                在C下建立文件输入内容:

                           

              配置输入如下内容:

                         --spring.config.location=classpath:config/app.properties,file:C:/usr/tomcatport.properties

相关代码:

           https://github.com/liushaoye/quick_start/tree/second

猜你喜欢

转载自www.cnblogs.com/liuyangfirst/p/9062368.html