19

I just switched a Spring Boot webapp from an external war deploy in Tomcat to a direct jar deploy with Spring Boot (and its internal Tomcat).

For Tomcat Run/Debug Configurations, Intellij gives you the to open browser after launch and go to http://localhost:8080/.

How can I do something similar with a a Spring Boot RUn/Debug Configuration. It runs the main class and just waits until I go to localhost:8080 from the browser myself.

jnash67
  • 271
  • 2
  • 7

3 Answers3

14

edit your run/debug configurations in the bottom - click on '+' right above 'Build' select 'launch web browser', put your app url, for example http://localhost:8181 enter image description here

so you will have enter image description here

click apply/ok, with that when you click Run/play button, it will launch browser with your url after the build

Sasha Bond
  • 984
  • 10
  • 13
  • 3
    Unfortunately, this launches the browser right away, it doesn't wait for the server to be started. – MikaelF May 05 '20 at 03:52
0

It doesn't seem like there is a way to do this. You can only launch external commands before launch it seems. Alternatively, you could try something like this in code as explained here.

Community
  • 1
  • 1
leeor
  • 17,041
  • 6
  • 34
  • 60
0

The only way I know how to do this is by making a Tomcat Server run configuration.