Get Started with Spring Boot…

mahesh reddy
3 min readApr 19, 2021

Before get started with Spring Boot lets have a look at what and why is Spring used.

Spring is basically a dependency injection container with some features and modules on top it, like IOC(Inversion of Control), AOP(Aspect Oriented Programming), DAO(Data Access Object), ORM(Object Relational Mapping), MVC(Model View Controller) etc..,

Spring is used to make java programmer life easy, making enterprise applications built easily and quickly and it improves speed, simplicity and productivity.

Spring is Good then why Spring Boot?

With all the Spring core, Data Access(JDBC, ORM etc..), Spring Web(web, servlets, struts), AOP… We need to configure a lot of things making it complex,so to cut these configurations and boiler plate code Spring Boot comes into picture.

With Spring Boot we can “just run” the application cutting all these configurations and create stand-alone, production-grade Spring based Applications.

Spring boot provides spring-boot-starter-parent is a project starter dependency which provides default configurations for our applications. it adds all the required jars and other things automatically. It also provides a dependency-management section so that you can omit version tags for dependencies you are using in pom.

<parent>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-parent</artifactId>

<version>1.4.0.RELEASE</version>

</parent>

There are so many starter dependencies, the most common starters used are:

  1. Spring-boot-starter
  2. Spring-boot-starter-aop
  3. Spring-boot-starter-data-jpa
  4. Spring-boot-starter-security
  5. Spring-boot-starter-test
  6. Spring-boot-starter-web

To get started with Spring Boot and to get spring boot project structure we use Spring Initializr

Initializr generates spring boot project with just what you need to start quickly!

Firstly go to https://start.spring.io/ , you will get this page and fill in the details and add dependencies which you require and click on generate and that’s it your spring boot project structure is created and just like that you can run your first spring boot application and get started with doing your things.

start.spring.io

To add dependencies click on add dependencies and select the required dependencies.

After generating the project, save it in workspace and In any IDE(eclipse…) import it as existing project and your project is ready.

Import as Existing Maven Projects

Conclusion :

Spring Boot application is simple and easy to create and makes programmer life easy by cutting all the configurations and boiler plate code and It also provides life saving features for programmers like spring-starter-parent and all other starter dependencies to configure things automatically.

We can test our application running or not by running @SpringBootApplication annotated class.

--

--