--- title: springport application.yaml端口 url: 'https://yayi.site/archives/springportapplicationyaml端口' cover: 'https://cdn.jsdelivr.net/gh/yan-bolan/picbed/img/动漫/結城友奈は勇者である/犬吠·埼 樹.png' tags: java abbrlink: 5c40672e date: 2020-10-08 21:06:20 updated: 2021-05-14 22:03:55 categories: --- 51 As explained in Spring documentation, there are several ways to do that: Either you set the port in the command line (for example 8888) -Dserver.port=8888 or --server.port=8888 Example : java -jar -Dserver.port=8888 test.jar Or you set the port in the application.properties server.port=${port:4588} or (in application.yml with yaml syntax) server: port: ${port:4588} --- Keep in mind that if your environment variables are MYPACKAGE_KEY_PUBLIC and MYPACKAGE_KEY_PRIVATE the keyname should only be MYPACKAGE_KEY. heroku ssh key \[https://devcenter.wercker.com/administration/environment-variables/ssh-keys/using-ssh-keys/\](https://devcenter.wercker.com/administration/environment-variables/ssh-keys/using-ssh-keys/) 系统变量
原创
springport application.yaml端口-springportapplicationyaml端口
本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
评论交流
欢迎留下你的想法