How to bootstrap a simple project with Spring Initializr?

The quickest way to generate Spring Boot projects is through Spring Initializr. Spring Initializr gives options to choose the language, build system, dependencies and JVM version for the project. Over the years, the popularity of spring initializr as the tool for generating Spring projects has grown exponentially and millions of projects are generated every year using the site.

On a high-level Spring Initializr tools take cares of the following points for any Spring based application

  • Project Folder Hierarchy
  • Detailed dependencies can be choosed to get it added to application
  • build script (Maven or Gradle) to build the application
  • Language and version (Initializr will add correct dependencies based on the version)
  • packaging (war or jar) – When we choose web in dependencies, the application will be generated to create WAR file with required folder structure

Spring Initializr is available on the web, most of the IDE has a built-in integration with the Initializr.

spring initializr

Fill every details in spring initializr page and click on generate project. Your project will be generated and will be saved as zip file.

Project Metadata

In above Spring Initializr site, under project metadata – when you click on options, it provides you following options to choose and the project will be generated based on these options.

Choosing Dependencies in advanced mode

spring initializr dependencies

Once every details are filled up in spring initializr page, click on generate project. Your project will be generated and will be saved as zip file.

Next, In Eclipse or Spring Tool Suite(STS IDE), Click File > Import > Existing Maven Project as shown below.

Navigate or type in the path of the folder where you extracted the ZIP file on the next screen.

Once you click Finish, Maven will take some time to download all the dependencies and initialize the project.

That’s it. Your first Spring project is ready!

Conclusion

Hence we how to bootstrap simple project using Spring Initializr and import the generated project to Eclipse or Spring Tool Suite IDE.

Please follow and like us:
error