When we start a new java based web application, spring boot comes as one of the best choices to start the backend development. As it is easy to develop, test and maintain.
These are the four ways to create a spring boot application
- Spring Boot CLI
- Using STS (IDE)
- Convert Maven / Gradle Application to Spring Boot
- Using Spring Starter Web
Prerequisite for all the four ways are Java 8 or above and Maven/Gradle.
Let us understand each options in detail
Spring Boot CLIUsing STS (IDE)
STS (Spring Tool Suite) comes with spring starter integrated with it. We can choose few options and the tool will generate a basic spring boot structure.
Follow the steps to create Spring Boot application using STS
- Install and Open STS in your desktop having all the prerequisite softwares installed.
- Click on File, goto New and select Spring Started Project
- Fill all the required details and click on next
- Select all the required dependencies from the list
- Click on Finish and wait for the project creation
1. Fill project name, group and artifact as per your choice
2. Select required dependencies for your project
Convert Maven / Gradle Application to Spring Boot
If you have an existing Maven or Gradle based application, it can be converted to a spring boot application be added Spring Boot Starter Parent tag in pom.xml or build.gradle and create a main class with @SpringBootApplication annotation.
Using Spring Started Webs
Spring Boot application can be created online and downloaded to your local machine. You need to open https://start.spring.io/ in your web browser and fill the form as it was done in STS for project creation.
Comments
Post a Comment