I am able to run few sample applications in my Eclipse (STS). Now, I want to run a web application within eclipse itself.
I tried with sample application "spring-boot-sample-web-jsp" given at the link and I am able to export its war into external tomcat and run the application. Now my question is how to run a Spring Boot Web application into eclipse itself?
This answer is late, but I was having the same issue. I found something that works.
In eclipse Project Explorer, right click the project name -> select "Run As" -> "Maven Build..."
In the goals, enter spring-boot:run
then click Run button.
I have the STS plug-in (i.e. SpringSource Tool Suite), so on some projects I will get a "Spring Boot App" option under Run As. But, it doesn't always show up for some reason. I use the above workaround for those.
Here is a reference that explains how to run Spring boot apps:
Spring boot tutorial
Just run the main
method which is in the class SampleWebJspApplication
.
Spring Boot will take care of all the rest (starting the embedded tomcat which will host your sample application).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With