maven——pom.xml解析
<modelVersion></modelVersion>//当前pom版本
<groupId>反写的公司网址+项目名</groupId>//主项目标识
<artifactId>项目名+模块名</artifactId>//模块标识
<version></version>//版本号
snapshot快照
alapha内部测试
beta公测
Release稳定
GA正式发布
<packaging></packaging>//打包方式,默认为jar,其他有war zip pom
<name><name>//描述名,一般在产生文档时才使用
<url></url>//项目地址
<description></description>//项目描述
<dependencies>//依赖列表
<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
<type></type>
<scope></scope>//依赖范围,如test表示这个jar只在测试里面有用
compile默认的范围,编译测试运行都有效
provided编译测试的时候有效
runtime测试运行时有效
test测试时有效
system和provided效果一样,但与本机系统相关联,可移植性差
import导入的范围,只在dependencyManagement中,表示从其他pom中导入depenecy的配置
<optional></optional>//设置依赖是否可选
<exclusion></exclusion>//排除依赖传递列表
</dependency>
</dependencies>
<dependencyManagement></dependencyManagement>//依赖管理,但并不会运行,主要是定义于父模块供子模块继承
<build>//为构件的行为提供相应的支持
<plugins>
<groupId><groupId>
<artifactId></artifactId>
<version></version>
</plugin>
</plugins>
</build>
<parent></parent>//用于继承父模块
<modules></modules>//用于聚合maven项目