Open
Description
Spring integration using JettyService
opens a port even when server.port: -1
is specified.
It's because JettyServletWebServerFactory
sets the port with 0
when -1
is specfied.
https://github.com/spring-projects/spring-boot/blob/3e4a9f5204ee2fe989583b17b77d8dab8558282a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyServletWebServerFactory.java#L164-L166
We should override the getWebServer
and fix it for consistent behavior with the Spring Tomcat integration.