| # 在自己项目中引入的依赖为如下 |
| <parent> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-starter-parent</artifactId> |
| <version>2.3.4.RELEASE</version> |
| </parent> |
| |
| # 该依赖的父项目如下 |
| <?xml version="1.0" encoding="UTF-8"?> |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| <modelVersion>4.0.0</modelVersion> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-dependencies</artifactId> |
| <version>2.3.4.RELEASE</version> |
| <packaging>pom</packaging> |
| <name>spring-boot-dependencies</name> |
| <description>Spring Boot Dependencies</description> |
| <url>https://spring.io/projects/spring-boot</url> |
| <licenses> |
| <license> |
| <name>Apache License, Version 2.0</name> |
| <url>https://www.apache.org/licenses/LICENSE-2.0</url> |
| </license> |
| </licenses> |
| <developers> |
| <developer> |
| <name>Pivotal</name> |
| <email>info@pivotal.io</email> |
| <organization>Pivotal Software, Inc.</organization> |
| <organizationUrl>https://www.spring.io</organizationUrl> |
| </developer> |
| </developers> |
| <scm> |
| <url>https://github.com/spring-projects/spring-boot</url> |
| </scm> |
| <properties> |
| <activemq.version>5.15.13</activemq.version> |
| <antlr2.version>2.7.7</antlr2.version> |
| <appengine-sdk.version>1.9.82</appengine-sdk.version> |
| <artemis.version>2.12.0</artemis.version> |
| <aspectj.version>1.9.6</aspectj.version> |
| <assertj.version>3.16.1</assertj.version> |
| <atomikos.version>4.0.6</atomikos.version> |
| <awaitility.version>4.0.3</awaitility.version> |
| <bitronix.version>2.1.4</bitronix.version> |
| <build-helper-maven-plugin.version>3.1.0</build-helper-maven-plugin.version> |
| <byte-buddy.version>1.10.14</byte-buddy.version> |
| <caffeine.version>2.8.5</caffeine.version> |
| <cassandra-driver.version>4.6.1</cassandra-driver.version> |
| <classmate.version>1.5.1</classmate.version> |
| <commons-codec.version>1.14</commons-codec.version> |
| <commons-dbcp2.version>2.7.0</commons-dbcp2.version> |
| <commons-lang3.version>3.10</commons-lang3.version> |
| <commons-pool.version>1.6</commons-pool.version> |
| <commons-pool2.version>2.8.1</commons-pool2.version> |
| <couchbase-client.version>3.0.8</couchbase-client.version> |
| <db2-jdbc.version>11.5.4.0</db2-jdbc.version> |
| <dependency-management-plugin.version>1.0.10.RELEASE</dependency-management-plugin.version> |
| <derby.version>10.14.2.0</derby.version> |
| <dropwizard-metrics.version>4.1.12.1</dropwizard-metrics.version> |
| <ehcache.version>2.10.6</ehcache.version> |
| ...... |
| |
| # 几乎声明了所有开发中常用的依赖的版本号,自动版本仲裁机制 |
| 1、见到很多 spring-boot-starter-* : *就某种场景 |
| 2、只要引入starter,这个场景的所有常规需要的依赖我们都自动引入 |
| 3、SpringBoot所有支持的场景,查看如下文档 |
| https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-starter |
| |
| 4、见到的 *-spring-boot-starter: 第三方为我们提供的简化开发的场景启动器。 |
| |
| 5、所有场景启动器最底层的依赖 |
| <dependency> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-starter</artifactId> |
| <version>2.3.4.RELEASE</version> |
| <scope>compile</scope> |
| </dependency> |
- 当我们引入spring-boot-starter-parent依赖后,就无需关注版本号,自动版本仲裁;因为父项目中spring-boot-dependencies已经写好了版本号
| 1、引入依赖默认都可以不写版本 |
| 2、引入非版本仲裁的jar,要写版本号。 |
| |
| 3、当我们要在自己的项目中添加依赖时 |
| 4、查看spring-boot-dependencies里面规定当前依赖的版本 用的 key。 |
| 5、在当前项目里面重写配置 |
| <properties> |
| <mysql.version>5.1.43</mysql.version> |
| </properties> |
| 主程序所在包及其下面的所有子包里面的组件都会被默认扫描进来,无需以前的包扫描配置 |
| 想要改变扫描路径,方式1:@SpringBootApplication(scanBasePackages="com.atguigu") |
| 方式2:@ComponentScan 指定扫描路径 |
| |
| @SpringBootApplication |
| 等同于,方式3: |
| @SpringBootConfiguration |
| @EnableAutoConfiguration |
| @ComponentScan("com.atguigu.boot") |
○
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术