多くのコンテキストの切り替えなどSpringBoot

方法1:別の複数のプロファイル

# /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

おすすめ

転載: www.cnblogs.com/danhuang/p/12593994.html