什么是SpringBoot
????????Spring Boot是由Pivotal團(tuán)隊(duì)提供的全新框架,其中“Boot”的意思就是“引導(dǎo)”,Spring Boot 并不是對(duì) Spring 功能上的增強(qiáng),而是提供了一種快速開發(fā) Spring應(yīng)用的方式。
Spring Boot 特點(diǎn)
- 嵌入的 Tomcat,無需部署 WAR 文件
????????Spring Boot 使用嵌入式的 Servlet 容器(例如 Tomcat、Jetty 或者 Undertow 等),應(yīng)用無需打成 WAR 包 。
- 簡(jiǎn)化Maven配置
????????Spring Boot 提供了一系列的“starter”來簡(jiǎn)化 Maven 配置。
- 簡(jiǎn)化XML(自動(dòng)配置)
????????Spring Boot 提供了大量的自動(dòng)配置類,開發(fā)人員不需要任何 xml 配置即可實(shí)現(xiàn) Spring 的所有配置
構(gòu)建 Spring Boot 項(xiàng)目
maven構(gòu)建SpringBoot項(xiàng)目
創(chuàng)建maven工程,不要使用骨架
?
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- 繼承springboot父工程-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.by</groupId>
<artifactId>SpringBoot_Junit</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<!-- 項(xiàng)目源碼及編譯輸出的編碼 -->
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- 添加啟動(dòng)器-->
<dependencies>
<!-- springboot的web啟動(dòng)器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- tomcat啟動(dòng)器依賴范圍-->
<!-- provided范圍:運(yùn)行和測(cè)試時(shí)不去除tomcat,打包時(shí)去除tomcat-->
<scope>provided</scope>
</dependency>
</dependencies>
</project>
創(chuàng)建啟動(dòng)類
@SpringBootApplication//表示當(dāng)前類是一個(gè)SpringBoot啟動(dòng)類
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
?文章來源地址http://www.zghlxwxcb.cn/news/detail-806225.html文章來源:http://www.zghlxwxcb.cn/news/detail-806225.html
?
到了這里,關(guān)于Spring Boot是什么-特點(diǎn)介紹的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!