日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

Spring Boot多環境指定yml或者properties

作者:geekmice 更新時間: 2024-07-15 編程語言

Spring Boot多環境指定yml或者properties

文章目錄

  • Spring Boot多環境指定yml或者properties
    • 加載順序
    • 配置指定某個yml

加載順序

● application-local.properties
● application.properties
● application-local.yml
● application.yml

image-20230823093516691

application.propertes

server.port=8111

application-local.propertes

server.port=8222

application.yml

spring:
  profiles:
    active: local

application-local.yml

server:
  port: 8081

image-20230823093713526

配置指定某個yml

spring:
  profiles:
    active: local

刪除properties之后,項目啟動

2023-08-23 09:38:29.423 INFO 22896 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ‘’
2023-08-23 09:38:29.819 INFO 22896 — [ main] c.g.s.SpringBootSelfExerciseApplication : Started SpringBootSelfExerciseApplication in 9.315 seconds (JVM running for 11.995)

image-20230823093917537

原文鏈接:https://blog.csdn.net/greek7777/article/details/132445537

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新