Spring Boot focuses on the Spring platform and third-party development libraries, simplifying the development of Spring-based products. So that you will not be troubled by various complicated affairs when you start Spring application development. Through Spring Boot, only a small amount of Spring configuration can be used to complete the initial construction of the project structure during development.
Features
- Create standalone Spring applications.
- Embeds Tomcat, Jetty and Undertow directly (no need to deploy WAR files).
- Simplified Maven configuration with specific POM files.
- Automatically configure Spring as much as possible.
- Provides product-level features such as metrics measurement, health checks, external configuration, etc.
- Absolutely no code generation or XML configuration .
The Reference Manual provides detailed descriptions of all functions, as well as usage guidelines for commonly used functions .
quick start
Spring Boot provides command-line tools to quickly prototype Spring applications. Configurable via Groovy scripting means no familiarity with Java syntax and a lot less template code. In the documentation, you can refer to Install the Spring Boot CLI using the command line.
If you are a Java developer, you can use start.spring.io to generate a basic project structure, then refer to the "Quick Start" example below, or read the beginner's guide .
It is recommended to use spring-boot with a dependency management system - copy and paste this script into your build. What if you are not familiar with these? See the chapter on building with Maven and Gradle in the Beginner's Guide.
1
2
3
4
5
6
7
8
9
10
11
|
<
parent
>
<
groupId
>
org
.springframework
.boot
<
/
groupId
>
<
artifactId
>
spring
-
boot
-
starter
-
parent
<
/
artifactId
>
<
version
>
1.2.7.RELEASE
<
/
version
>
<
/
parent
>
<
dependencies
>
<
dependency
>
<
groupId
>
org
.springframework
.boot
<
/
groupId
>
<
artifactId
>
spring
-
boot
-
starter
-
web
<
/
artifactId
>
<
/
dependency
>
<
/
dependencies
>
|
hello/SampleController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
package
hello
;
import
org
.
springframework
.
boot
.
*
;
import
org
.
springframework
.
boot
.
autoconfigure
.
*
;
import
org
.
springframework
.
stereotype
.
*
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
*
;
@Controller
@EnableAutoConfiguration
public
class
SampleController
{
@RequestMapping
(
"/"
)
@ResponseBody
String
home
(
)
{
return
"Hello World!"
;
}
public
static
void
main
(
String
[
]
args
)
throws
Exception
{
SpringApplication
.
run
(
SampleController
.
class
,
args
)
;
}
}
|