SpringBoot项目根据Environment环境更改profiles配置。
MSCode微服务平台框架 mscodecloud.com 代码示例
server:
port: 9000
---
spring:
profiles: development
server:
port: 9001
---
spring:
profiles: production
server:
port: 0
spring.profiles.active=production
$ java -jar -Dspring.profiles.active=production demo-0.0.1-SNAPSHOT.jar
MSCode微服务平台框架 mscodecloud.com 基于Spring Cloud、Spring Boot和Activiti7工作流,提供所有源码和详尽文档,帮助企业快速开发分布式业务系统。
本文介绍如何在SpringBoot项目中根据不同的运行环境(如开发、生产)切换配置,通过使用profiles属性实现对server port的动态调整,适用于MSCode微服务平台框架。
15万+

被折叠的 条评论
为什么被折叠?



