网站首页 > 博客文章 正文
1.单yml文件
使用---分割开发/测试/生产环境
#指定配置环境 通用信息
#多环境公用的属性 比如/aaa是所有环境都生效的
#如果通用环境和特定环境的冲突了,那么特定环境是生效的
spring:
profiles:
active: dev
server:
servlet:
context-path: /aaa
---
#开发环境
spring:
config:
activate:
on-profile: dev
server:
port: 8081
servlet:
context-path: /bbb
---
#测试环境
spring:
config:
activate:
on-profile: test
server:
port: 8082
---
#生产环境
spring:
config:
activate:
on-profile: pro
server:
port: 8083
2.多yml文件的使用
在application.yml中指定激活的文件
spring:
profiles:
active: test
则application-test.yml是生效的
3.多环境开发分组
spring:
profiles:
group:
"dev": devServer,devDB,devSelf
#"test": testServer,testDB,testSelf
active: dev
猜你喜欢
- 2025-05-05 Springboot项目中几种跨域的解决方法
- 2025-05-05 快来试试这款一行代码实现多平台文件存储的工具!
- 2025-05-05 Spring Boot3 整合 Redis 实现数据缓存操作全解析
- 2025-05-05 Spring Boot 优雅实现多租户架构(多租户开源框架 java)
- 2025-05-05 手把手教你搭建Spring Boot项目(springboot工程搭建步骤)
- 2025-05-05 详细介绍一下Spring Boot配置文件的加载顺序?
- 2025-05-05 第三章:SpringBoot 配置文件(springboot配置文件详解)
- 2025-05-05 Spring Boot3 整合 Thymeleaf 模板引擎全攻略
- 2025-05-05 震碎认知!将原理融会贯通到顶点的SpringBoot实战项目
- 2025-05-05 Spring Boot3 整合 Nacos 实现配置管理全解析
你 发表评论:
欢迎- 最近发表
-
- 解决Win10打开软件提示“服务器没有及时响应或控制请求”
- 用友UAP解开非结构化大数据处理与分析的密码
- Windows 25H2 修复底层崩溃(windows修复环境)
- 开源技巧:使用Docker实现交互式任务
- Win11 任意版本 直接安装 Android 应用 教程完整版
- Windows Terminal已成为Windows 11操作系统的默认终端
- 那些好莱坞电影中炫酷的特效 原来是这么拍的
- Windows 10 Build 21327.1010发布:测试服务管道更新
- Made in China: The story behind the label
- PowerShell登录远程Linux系统(powershell开启远程桌面)
- 标签列表
-
- ifneq (61)
- 字符串长度在线 (61)
- googlecloud (64)
- flutterrun (59)
- 系统设计图 (58)
- powershellfor (73)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- ubuntu升级gcc (58)
- nacos启动失败 (64)
- ssh-add (70)
- jwt漏洞 (58)
- macos14下载 (58)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- qcombobox样式表 (68)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)