方式一:分开多个配置文件

# /src/main/resources/application.yaml
server:
	port: 8080
spring:
	profiles:
		active: dev
# /src/main/resources/application-dev.yaml
server:
	port: 8081
# /src/main/resources/application-test.yaml
server:
	port: 8082

方式二:写在同一个配置文件中

# /src/main/resources/application.yaml
server:
	port: 8080
spring:
	profiles:
		active: dev

---
server:
	port: 8081
spring:
	profiles: dev

---
server:
	port: 8082
spring:
	profiles: test

相关文章:

  • 2021-07-01
  • 2021-10-04
  • 2021-09-01
  • 2021-05-01
  • 2022-12-23
  • 2021-08-02
  • 2021-08-26
  • 2021-11-10
猜你喜欢
  • 2021-08-03
  • 2021-06-04
  • 2021-12-07
  • 2021-04-13
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案