Software:Spring Boot
Original author(s) | Rod Johnson |
---|---|
Developer(s) | VMware |
Initial release | April 2014 |
Written in | Java |
Platform | Java EE |
Type | Application framework |
License | Apache License 2.0 |
Spring Boot is a convention-over-configuration extension for the Spring Java platform intended to help minimize configuration concerns while creating Spring based applications.[1][2] Most of the application can be preconfigured using Spring team's "opinionated view"[3][4] of the best configuration and use of the Spring platform and third-party libraries.
Features
- Embedded Tomcat, Jetty or Undertow web application server [5]
- Provide opinionated 'starter' Project Object Models (POMs) for the build tool. The only build tools supported are Maven and Gradle.[6][7]
- Automatic configuration of the Spring Application [8]
- Provide production-ready[1] functionality such as metrics,[9] health checks [9] and externalized configuration[10]
- No code generation is required.[5]
- No XML configuration is required.[6]
- Support for Kotlin in addition to Java.[11]
Bootstrapping DispatcherServlet
Spring Boot does not require manual configuration of the DispatcherServlet
, since it automatically configures the application based on the configuration it detects.[12]
SpringBootServletInitializer
Spring Boot has a class SpringBootServletInitializer
, which is a specialization of the WebApplicationInitializer
.[12] This SpringBootServletInitializer
is an out-of-the-box implementation of WebApplicationInitializer
, which eliminates the need for the developer to construct their own implementation of the WebApplicationInitializer
class.[12]
Configuration properties
The configuration properties for the Spring Boot application can be specified in the application.properties
or application.yml
file.[12]
Examples of properties that can be included in this file include the server.port
and spring.application.name
properties.[12]
Autoconfiguration
@SpringBootApplication
Spring boot has an annotation, @SpringBootApplication
, which allows the Spring Boot application to autoconfigure third-party libraries and detected features found on the classpath.[12] As an example, the class that has the @SpringBootApplication
annotation can extend the SpringBootServerInitializer
class if the application is packaged and deployed as a WAR file.[12]
The @SpringBootApplication
annotation combines three Spring-specific annotations: @SpringBootConfiguration
, @EnableAutoConfiguration
and @ComponentScan
.[13]
@SpringBootConfiguration
The @SpringBootConfiguration
annotation is a specialization of the Spring-specific @Configuration
annotation.[13] The class with the @SpringBootConfiguration
is marked as the configuration class for the Spring Boot application.[13]
@EnableAutoConfiguration
The @EnableAutoConfiguration
annotation is Spring-specific annotation that enables the Spring Boot automatic configuration. [13]
Actuator
The Spring Boot Actuator allows for monitoring and management capabilities for the Spring Boot Application.[14] A major advantage of using the Spring Boot Actuator is it implements a number of production-ready features without requiring the developer to construct their own implementations.[14]
If Maven is used as the build tool, then the spring-boot-starter-actuator
dependency can be specified in the pom.xml
configuration file.[15]
Integration with Spring Framework Modules
Spring Boot has a number of existing Spring Framework Modules.
Spring Security
Spring Boot has integration with the Spring Security Module. The simplest way for integrating Spring Boot with Spring Security is to declare the starter dependency in the build configuration file.[16]
If Maven is used as the build tool, then the dependency with artifact ID spring-boot-starter-security
dependency can be specified in the pom.xml
configuration file.[16]
Application Servers
By default, Spring boot provides embedded web servers (such as TomCat) out-of-the-box.[17] However, Spring Boot can also be deployed as a WAR file on a standalone WildFly application server.[18]
If Maven is used as the build tool, there is a wildfly-maven-plugin
Maven plugin that allows for automatic deployment of the generated WAR file.[18]
References
- ↑ 1.0 1.1 Walls 2016, p. vii, §foreword.
- ↑ Walls 2016, pp. 37-48, §2.3.
- ↑ Walls 2016, p. 48, §2.4.
- ↑ Deinum & Cosmina 2021, pp. 21-22, §2 Spring Framework Fundamentals.
- ↑ 5.0 5.1 Walls 2016, p. 7, §1.1.3.
- ↑ 6.0 6.1 Walls 2016, p. x, §Preface.
- ↑ Musib 2022, p. 9, §1.2.1 Maven vs Gradle.
- ↑ Walls 2016, pp. 4-5, §1.1.2.
- ↑ 9.0 9.1 Walls 2016, pp. 124-139, §7.
- ↑ Walls 2016, pp. 49-69, §3.1-§3.2.3.
- ↑ Musib 2022, p. 9, §1.2.2 Java vs Kotlin.
- ↑ 12.0 12.1 12.2 12.3 12.4 12.5 12.6 Deinum & Cosmina 2021, pp. 52-54, §2 Spring Framework Fundamentals - Spring Boot.
- ↑ 13.0 13.1 13.2 13.3 Walls 2019, pp. 11-17, §1.2.2 Examining the Spring project structure.
- ↑ 14.0 14.1 Musib 2022, pp. 144-145, §4.4 Spring Boot Actuator.
- ↑ Musib 2022, pp. 145-146, §4.4.1 Configuring Spring Boot Actuator in a Spring Boot application.
- ↑ 16.0 16.1 Musib 2022, pp. 187-192, §5.2.1 Configuring Spring Boot Actuator in a Spring Boot application.
- ↑ Musib 2022, pp. 7-8, §1.1.4 Spring Boot components.
- ↑ 18.0 18.1 Musib 2022, pp. 406-417, §9.2 Deploying Spring Boot application as WAR in the wildfly application server.
- Deinum, Marten; Cosmina, Iuliana (2021). Pro Spring MVC with WebFlux. Berkeley, CA: Apress. doi:10.1007/978-1-4842-5666-4. ISBN 978-1-4842-5665-7.
- Musib, Somnath (July 12, 2022). Spring Boot in Practice. Simon and Schuster. ISBN 978-1-61729-881-3.
- Walls, Craig (Jan 3, 2016). Spring Boot in Action. Manning. ISBN 978-1-61729-254-5.
- Walls, Craig (2019). Spring in Action. Manning. ISBN 978-1-61729-494-5.
External links
Original source: https://en.wikipedia.org/wiki/Spring Boot.
Read more |