How to get Intellij to launch the browser automatically after spring-boot webapp is ready

I just switched Spring Boot webapp from an external war deployed to Tomcat to deploying a direct jar using Spring Boot (and its internal Tomcat).

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

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

+8
source share
2 answers

There doesn't seem to be a way to do this. You can only run external commands before starting. Alternatively, you can try something like this in code, as described here .

0
source

edit your startup / debugging settings at the bottom - click "+" to the right above "Build" select "Run web browser", specify the URL of your application, for example http: // localhost: 8181 enter image description here

so you will have enter image description here

click "Apply / OK", while when you click the "Run / Play" button, it will launch a browser with your URL after assembly

0
source

All Articles