How to create a Spring Boot Project with Spring Initilizr

To create a project in Spring Boot we can use ‘Spring Initializr’ utility.

Spring Initializr

Spring Initializr is a Spring tool that helps us to create an initial project, from scratch, by choosing in a simple way the dependencies we need.

We open the site Spring Initializr

There we have multiple options:

  • Choose whether we will use Maven or Gradle to build our project.
  • The versions of Spring and Java we will use.
  • The data of your project for the group and the artifact.
  • The dependencies you need.

For our project we will choose Gradle and the Spring Web dependency. Once you have chosen the options you can browse to preview your build.gradle and how your project will look like. In the GENERATE option you download the .zip file of the project ready to use.

Spring Initializr

Download the file and unzip it.

Spring Initializr

We open it with our IDE, in my case Intellij

Spring Initializr

From the command line we can run the application.

gradlew bootRun

Spring Initializr

Conclusion

Spring Initializr is a tool that simplifies the initial creation and dependencies of your project.

References

Spring Initializr GitHub

If you wish to send me any corrections or suggestions, please contact me.
Thanks for your feedback :)

See also