运行的代码为 java -jar xxx.jar
在后边添加–server.port=8888
等于在application 添加了一个属性
java -jar xxx.jar --server.port=8888
多环境配置
程序分为开发。测试。生产
application-dev.properties 开发环境
application-test.properties 测试环境
application-prod.properties 生产环境
配置要在application.properties 文件中通过
spring.profiles.active
配置
执行的时侯
jave -jar xxx.jar --spring.profiles.active=test