# 统一的配置环境(生产环境active: provider。测试环境:active: test。开发环境:active: dev)
spring:
profiles:
active: dev
1.测试环境application-test.yml
# 测试环境
server:
port: 8081
servlet:
context-path: /***
2.开发环境active: dev
# 开发环境
server:
port: 80
servlet:
context-path: /
3.生产环境active: provider
# 生产环境
server:
port: 8888
servlet:
context-path: /
将同一环境application.yml修改为: active: dev,使用开发环境运行结果:此时使用的是80端口
在终端,项目目录下,将项目打包
桌面打开窗口
输入端口配置以及当前使用的环境(生产环境)
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有