Spring Boot 内置 Tomcat 端口默认是8080。修改端口的方式有:

1.application.yml

src/main/resources/application.yml


1
2
server:
port: 8888

2.application.properties

src/main/resources/application.properties


1
server.port=8888

3.命令行

terminal


1
$ java -Dserver.port=8888 -jar xxxx.jar