2024.12.11(SpringBoot知识点总结)

3.1.2 分析spring-boot-starter-web
按住Ctrl点击pom.xml中的spring-boot-starter-web,跳转到了spring-boot-starter-web的pom.xml,xml配置如下(只摘抄了部分重点配置):


4.0.0

org.springframework.boot
spring-boot-starters
2.0.1.RELEASE

org.springframework.boot
spring-boot-starter-web
2.0.1.RELEASE
Spring Boot Web Starter

<dependencies>
	<dependency>
  		<groupId>org.springframework.boot</groupId>
  		<artifactId>spring-boot-starter</artifactId>
  		<version>2.0.1.RELEASE</version>
  		<scope>compile</scope>
	</dependency>
	<dependency>
  		<groupId>org.springframework.boot</groupId>
  		<artifactId>spring-boot-starter-json</artifactId>
  		<version>2.0.1.RELEASE</version>
  		<scope>compile</scope>
	</dependency>
	<dependency>
  		<groupId>org.springframework.boot</groupId>
  		<artifactId>spring-boot-starter-tomcat</artifactId>
  		<version>2.0.1.RELEASE</version>
  		<scope>compile</scope>
	</dependency>
	<dependency>
  		<groupId>org.hibernate.validator</groupId>
  		<artifactId>hibernate-validator</artifactId>
  		<version>6.0.9.Final</version>
  		<scope>compile</scope>
	</dependency>
	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-web</artifactId>
  		<version>5.0.5.RELEASE</version>
  		<scope>compile</scope>
	</dependency>
	<dependency>
  		<groupId>org.springframework</groupId>
  		<artifactId>spring-webmvc</artifactId>
  		<version>5.0.5.RELEASE</version>
  		<scope>compile</scope>
	</dependency>
</dependencies>
从上面的spring-boot-starter-web的pom.xml中我们可以发现,spring-boot-starter-web就是将web开发要使用的spring-web、spring-webmvc等坐标进行了“打包”,这样我们的工程只要引入spring-boot-starter-web起步依赖的坐标就可以进行web开发了,同样体现了依赖传递的作用。
posted @   ysd666  阅读(3)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
点击右上角即可分享
微信分享提示