Sunday, June 25, 2017

How to start to implement SpringBoot application.

There are 4 different ways to start a SpringBoot application.
1. Create a simple maven project and change the necessary changes to the pom file
2. Spring Initializr (online application)
3. Spring Boot CLI
4. STS IDE

I'll briefly explain above 4 ways to get a basic knowledge about mechanisms.

1. Create a simple maven project and change the necessary changes to the pom file
You can create a simple maven project and then,

       a.) Add the below parent tag
<parent>
 <groupId>org.springframework.boot</groupId>    
 <artifactId>spring-boot-starter-parent</artifactId>        
 <version>1.4.2.RELEASE</version>
</parent>

      b.) Add the spring-boot-starter-web dependency
<dependency> 
 <groupId>org.springframework.boot</groupId>    
 <artifactId>spring-boot-starter-web</artifactId> 
</dependency>

      c.) Add the supported java version (1.8)
<properties>   
 <java.version>1.8</java.version>  
</properties>
Then build the project.

2. Spring Initializr (online application)
Go to the http://start.spring.io & Give necessary information & generate the project

3. Spring Boot CLI
Download spring-boot-cli & go to bin and can write Groovy script to generate the project

4. STS IDE
    a. You can download the STS editor by accessing url [1]
    b. Extract the download file and start the STS IDE
Since, I'v been using the Ubuntu operating system, I downloaded the spring-tool-suite-3.8.4.RELEASE-e4.6.3-linux-gtk-x86_64.tar.gz file. Then extracted it. Finally started the STS file located in <extracted_location>/sts-bundle/sts-3.8.4.RELEASE/
   c. File -> New -> Spring Starter Project
   d. Then you can give a 'name' and select the 'Spring Boot Version' and select the necessary available dependency and finish

[1] https://spring.io/tools/sts/all


No comments:

Post a Comment