[Spring boot] Application properties and configurations

欠伸展肢体,吟咏心自愉。这篇文章主要讲述[Spring boot] Application properties and configurations相关的知识,希望能为你提供帮助。
We can use different application properties

[Spring boot] Application properties and configurations

文章图片

application.properties:
server.port=9090

 
application-prod.properties:
server.port=80

 
application-test.properties:
server.port=9090

 
We can setup different properties for different env, more about configration can be found here
 
Run:
-Dspring.profiles.active=test

WIll run test env:
[Spring boot] Application properties and configurations

文章图片

【[Spring boot] Application properties and configurations】 

    推荐阅读