Spring Boot Overview
The Problem Without Spring Boot. Building a spring application is really difficult like...
- What Maven archetype to use?
- Which Maven dependencies do I need?
- How do I set Up configuration (XML or JAVA)?
- How do I install the server?(glassfish,Tomcat,JBoss,ibm etc...)
- Mode Detail Spring Boot Development Go to this Link Spring Boot Reference Manual
Using Spring Boot Resolve This Problem
- Create stand-alone Spring applications
- Embed glassfish,Tomcat,JBoss,ibm directly (no need to deploy WAR files)
- Provide opinionated 'starter' dependencies to simplify your build configuration
- Automatically configure Spring and 3rd party libraries whenever possible
- Provide production-ready features such as metrics, health checks, and externalized configuration
- Absulutely no code generation and no requirement for XML configuration
- Make it easier to get started with Spring Development
- Minimize the amount of manual configuration
- Preform auto-configuration based on props files and JAR classpath
- Help to resulve dependency conflicts (Maven or Gradle)
- Provide an embedded HTTP server so you can get start Quickly
Create Spring Boot Project Using Spring Initializr
Quickly Create a starter Spring Project
About Spring Boot Project Structure
- mvnw allows you to run a Maven project
- No need to have Maven installed or present on your path
- If correct version of Maven is NOT found on your computer
- Automatically downloads correct version and runs Maven
- Two files are provided
- mvnw.cmd for MS Windows E:\coder_workstation\spring-boot\spring-boot-jar\spring-boot-jar>mvnw clean compile test
- mvnw.sh for Linux/Mac ./mvnw clean compile test
- If you already have Maven installed previously
- Then you can ignore/delete the mvnw files
- Just use Maven as you normally would
About Spring Boot Embedded Server
Spring Boot provider Embedded Server by default tomcat server Embedd in spring boot.
So no need to install any external server.
if you want you can change easily using the application.properties file
What does @SpringBootApplication?
@SpringBootApplication is composed of the following annotations:
||Enables Spring Boot's auto-configuration support
||Enables component scanning of current package Also recursively scans sub-packages
||Able to register extra beans with @Bean or import other configuration classes