配置文件 pom.xml 解析
参数含义
1. gav - groupId,artifictId,version:
- groupId - 项目或组织的唯一标志,配置引入的包的绝对路径。
- artifactId - 包通用名称。
- version - 包的版本。
- package - 打包机制,通常有jar,war,rar等等。
2. scoup 指定当前包的依赖范围, 包括 compile,provide,runtime,test,system。
- complile- 包默认的范围,依赖会在编译,运行,测试时需要,因此会被打包在项目中。
- provide - 依赖在编译,测试时需要。由jdk 或 外部容器提供后使用。
- runtime - 在运行或测试需要,例如 JDBC 驱动。
- test - 依赖在测试时需要。例如 junit, 不会被打包。
- system - 本地依赖,提供本地系统的 jar 包路径,因此一般不用。
3. exclusion 屏蔽依赖
4. properties 定义一些常量
5. prerequisites 项目构建环境的前提条件
6. build 构建项目
- sourceDirectory / testSourceDirectory 相对与pom.xml的源码和测试源码路径。项目构建时,自动加入。
- outputDirectory / testOutputDirectory 编译后的应用文件和测试代码 class 文件存放的目录。
- resources / testResources 项目相关资源。
7. module 子项目的相对路径,相对于pom.xml
8. type 依赖类型