Getting started with Spring Boot + Eclipse
Overview
Spring Boot helps us to create stand-alone, production-grade Spring-based applications that we can run.
Spring Boot is an opinionated addition to the Spring platform, focused on convention over configuration — highly useful for getting started with minimum effort. You can use Spring Boot to create Java applications that can be started by using java -jar
or more traditional war deployments.
Primary goals are:
- Provide a radically faster and widely accessible getting-started experience for all Spring development.
- Be opinionated out of the box but get out of the way quickly as requirements start to diverge from the defaults.
- Provide a range of non-functional features that are common to large classes of projects (such as embedded servers, security, metrics, health checks, and externalized configuration).
- Absolutely no code generation and no requirement for XML configuration.
Developing Your First Spring Boot Application
let’s use https://start.spring.io/ web site to generate the base for our project.
1.) Provide details like Project Type, Language, Spring boot version etc.. as shown below.
2.) Spring Initializer provides an option to view your project structure before downloading as shown below.
3.) Download the project and import to your favorite IDE. Go to File -> Import -> Maven -> Import Existing Maven Projects
3.2) After clicking Finish, Eclipse try to download all Dependencies, make sure you have Internet connection and proxy settings are enabled (incase you are behind company firewall).
3.3) Once imported, you should be able to see below project structure
3.4) Open Boot Dashboard, right click on getting_started project, click on Re(start) menu to start our project
You should be able to see below message, if your project is successfully imported and ran.
Started GettingStartedApplication in 1.696 seconds (JVM running for 5.629)
Bonus Point
if you like to change Banner for your project by creating banner.txt and put it inside resources folder.
Conclusion:
If you would like to refer to the full code, do check https://github.com/projectk-user1/Springboot-learning.git
Feel free to provide your suggestions in comments section.