美文网首页Eclipse
springBoot spring.profiles.activ

springBoot spring.profiles.activ

作者: jwyh | 来源:发表于2019-10-24 11:42 被阅读0次

1、springBoot提供spring.profiles.active配置用于区分不同运行环境。

当我们项目需要根据运行的环境环境来读取不同配置文件时,可使用指定spring.profiles.active来读取对应的文件。

当配置的环境找不到是,则读取application.properties文件

比如:spring.profiles.active=dev1,则读取application.properties

spring.profiles.active=test则读取application-test.properties

下面是提供eclipse的配置方式,其他ide配置方式类似

相关文章

网友评论

    本文标题:springBoot spring.profiles.activ

    本文链接:https://www.haomeiwen.com/subject/drurvctx.html