1

I tried to use this answer to start another instance of Spring Boot

Spring Boot - how to configure port

mvn spring-boot:run -Dserver.port=8081

It gave an error

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8080 failed to start.

It also restarted the other instance (live reload?).

Chloe
  • 25,162
  • 40
  • 190
  • 357
  • have you checked that this port is free? it is likely that the previous run didn't end correctly and it is still blocking the port. try with a different port to prove that or restart your machine for example – Hasson Oct 02 '18 at 19:52

2 Answers2

1

It worked with

env SERVER_PORT=8081 mvn spring-boot:run

It also works with (Spring Boot 1.5.x)

mvn spring-boot:run -Drun.arguments="--server.port=8081"
Chloe
  • 25,162
  • 40
  • 190
  • 357
0

In Sprint Boot run/debug configuration we can use the VM Option to define port

 -Dserver.port=9090

So by defining different ports we can start multiple instances