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

 

 

 

 

1、指定文件名称: 

     打开IDEA编辑位置:

                     

    找到如图位置:

                     

             点开后方设置

                   

           设置输入如下内容:(默认的配置文件名字可以使用--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

 

posted @ 2018-05-20 05:13  北极的大企鹅  阅读(1573)  评论(0编辑  收藏  举报
阅读 - 79万