如何配置 Spring Boot 应用程序侦听的 TCP/IP 端口,使其不使用默认端口 8080。
As 文档中说 http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-change-the-http-port任意设定server.port
使用 jvm 的命令行选项作为系统属性-Dserver.port=8090
or add application.properties
in /src/main/resources/
with
server.port=8090
对于随机端口使用:
server.port=0
同样添加application.yml
in /src/main/resources/
with:
server:
port: 8090
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)