Issue
How do I configure the TCP/IP port listened on by a Spring Boot application, so it does not use the default port of 8080.
Solution
As href="http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-change-the-http-port" rel="noreferrer">said in docs either set server.port
as system property using command line option to jvm -Dserver.port=8090
or add application.properties
in /src/main/resources/
with
server.port=8090
For random port use
server.port=0
Similarly add application.yml
in /src/main/resources/
with
server:
port : 8090
Answered By - Paul Verest
Answer Checked By - Mary Flores (JavaFixing Volunteer)