In spring-projects-experimental/spring-boot-testjars#80 we have been discussing this. Testjars relies on the app it is running to be a Spring Boot webserver. It then switches on the WebServerPortFileWriter and watches the PORTFILE to read the port of the running application. This is neat, but it doesn't work if the app is not a web-server (MVC or webflux essentially). Maybe the PORTFILE could be generalized in Boot so that other listeners could be activated in a similar fashion? Or maybe there's a better way.