Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Spring Boot web application in Eclipse itself?

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?

like image 559
Krishan Babbar Avatar asked May 15 '14 12:05

Krishan Babbar


2 Answers

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

like image 82
Darren Parker Avatar answered Oct 21 '22 19:10

Darren Parker


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).

like image 26
geoand Avatar answered Oct 21 '22 20:10

geoand