Spring Boot Initilizr With IDEs

Spring Boot Initilizr is used to quick start new Spring Boot Maven/Gradle projects within no time. It generates initial project structure and build scripts to reduce Development time.

As we discussed in my previous post, Spring Boot Initilizr is available in the following forms:

  1. Spring Boot Initilizr With Spring Boot CLI
  2. Spring Boot Initilizr With Web Interface
  3. Spring Boot Initilizr With IDEs/IDE Plugins
  4. Spring Boot Initilizr With ThirdParty Tools

We are going to use Spring Tool Suite (STS) to develop all our Spring Boot programs. By default, STS comes with Spring Boot Plugins, no need to install/configure it.

Spring Boot Initilizr With IDEs/IDE Plugins

Following steps to create a Spring MVC Maven project with Spring Tool Suite.(Similar steps with other IDEs too.)

  • Select “Spring Stater Project” Menu option from “File >> New” Menu
  • We will get the following “New Spring Stater Project” Wizard to provide our project related information

Spring Starter Project

  • Provide Project details as shown below and Click on “Next” Button

  • Select dependencies for the project as shown below and Click on “Finish” button to create our new Spring Boot Project

  • Now Spring Tool Suite creates a Maven Project and downloads all required Jars to our Maven Local Repository.
  • If we observe the project structure, pom.xml and Java Source files, they all are similar to the files we have created by using Spring Boot Initilizr With Web Interface

Execute Spring Boot Application

We have created the Spring Boot Application using STS in no time. Its time to run the application.

When  we run the application, Spring Boot automatically do the following things.

  1. Creates a Spring MVC application
  2. Starts Embedded Tomcat Server with default port number: 8080 (We can configure jetty server if we want)
  3. Deploy our Spring MVC application into Tomcat Sever

Mouse Right click on “SbiIDEProject.java” file and select “Spring Boot App” option from “Run As” Menu to run this Program as Spring Boot Application. We will see the console window like below.

Access our Spring Boot MVC application with http://localhost:8080/

As we don’t provide any mappings or view templates, it  shows default error page like below.

We will discuss the internals of the Spring Boot Application like @SpringBootApplication in next posts.


Click Here to Leave a Comment Below 0 comments