// apache 家的 maven
maven 生命周期
// 清理 编译 测试 报告 打包 部署
maven 解决的问题
// 项目中的 jar包的管理
// 依赖传递
// 聚合部署
// 项目打包,部署
maven 原理
// maven 是有一个仓库的
// 我们把所有的 jar 包都放到仓库里 用到哪个 jar包 就去取哪个 。
// pom 文件 指引我们去拿什么东西
maven 常用命令
//mvn compile 编译
// mvn clean 清除
// mvn test 把所有的测试类 都走一遍
// mvn install 安装到本地仓库
// mvn package 项目打包
// maven 都是根据 pom 文件 找到相对应的东西
maven 坐标的主要组成
// groupId 定义当前maven项目属于哪个项目
// artifactId 定义实际项目中的某一个模块
// version 定义当前项目的版本
// packaging 定义当前项目的打包方式(jar war pom)
// 根据这种坐标 可以找到唯一依赖
依赖管理
//添加依赖的时候
第一种依赖方式
打的是jar 包的情况
// 是从仓库里找到的jar包
// jar包 依赖的传递
// 有三个项目 A B C
// B 项目 依赖了 A 项目
// C 项目 依赖了 B 项目
// C 项目 同样可以使用 A 项目
//pom 文件里的标签
// <dependencies>
// <dependency>
// <groupId>org.springframework.boot</groupId>
// <artifactId>spring-boot-starter-test</artifactId>
// <version>2.6.7</version>
// </dependency>
// </dependencies>
第二种依赖方式
packaging 如果打的是 pom 包
// 哪个地方 需要使用这个pom包 就需要以下继承方式 来引入依赖
pom 文件里的标签
// <parent>
// <groupId>org.springframework.boot</groupId>
// <artifactId>spring-boot-starter-parent</artifactId>
// <version>2.6.7</version>
// </parent>
仓库管理
// 仓库管理 分为 1. 本地仓库 2. 私服仓库 3. 中央仓库
// 可以根据 maven 坐标定义每一个 jar 包在仓库中存储的位置
// 主要配置 文件是 conf 目录下的 settings.xml 文件
// 比如把 中央仓库的下载地址 配置成 国内的 阿里云的
// http://maven.aliyun.com/nexus/content/groups/public
//引入多个 jar 架包冲突的时候
// 需要排除依赖
// <exclusions>
// <exclusion>
// <groupId>排除的groupId</groupId>
// <artifactId>排除的artifactId</artifactId>
// </exclusion>
// </exclusions>