我使用的是Spring Boot 1.5.9.RELEASE,它默认在两个端口上启动 .

Tomcat initialized with port(s): 8080 (http) 8090 (http)

Tomcat started on port(s): 8080 (http) 8090 (http)

我尝试使用server.port设置不同的端口,但是只覆盖第一个端口8080到另一个端口,8090仍然存在 . 还尝试将 Actuator 端口与management.port更改为其他端口 .

我看到Spring Boot 2.x没有这个问题 . 有什么理由说明spring boot 1.x默认运行在两个端口上,以及如何在单个端口上运行?

application.properties

server.context-path=/test-app

endpoints.actuator.enabled=true

management.security.enabled=false

management.health.defaults.enabled=true

management.health.mail.enabled=false

management.port=8981