博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
maven 继承关系和聚合
阅读量:7260 次
发布时间:2019-06-29

本文共 3536 字,大约阅读时间需要 11 分钟。

maven继承管理 让版本的管理只在一个地方改变

 

modules用于聚合,把执行的项目都放到同一的地方用module包括,可以省去一个个项目去mvn install,这样可以所有项目一次聚合 mvn install

传递性依赖原则:

A-->B

A-->C

1.路径最近者优先

2.路径相同,第一声明者优先

注意:

1.dependencyManagement中定义的依赖子module不会共享
2.dependencies中定义的依赖子module可以共享

 

dependencyManagement的使用 就是方便管理版本,子项目中要引入group id和atifact id

 

在parent项目的pom.xml配置

1 
3
4.0.0
4 5
cn.itcast.maven
6
Parent
7
0.0.1-SNAPSHOT
8
pom
9 10
Parent
11
http://maven.apache.org
12
13
14
../Hello
15
../HelloFriend
16
../MakeFriends
17
../Web
18
19 20
21
UTF-8
22
23 24
25
26 27 28
29
30
junit
31
junit
32
4.9
33
test
34
35
36
cn.itcast.maven
37
Hello
38
0.0.1-SNAPSHOT
39
compile
40
41
42
cn.itcast.maven
43
HelloFriend
44
0.0.1-SNAPSHOT
45
46
47
cn.itcast.maven
48
MakeFriends
49
0.0.1-SNAPSHOT
50
51
52
53 54
55
56
releases
57
Internal Releases
58
http://localhost:8080/nexus-2.1.2/content/repositories/releases/
59
60
61
snapshots
62
Internal Snapshots
63
http://localhost:8080/nexus-2.1.2/content/repositories/snapshots/
64
65
66 67 68

 

Hello.pom

1 
2
4.0.0
3 4
Hello
5 6 7
8
cn.itcast.maven
9
Parent
10
0.0.1-SNAPSHOT
11
../Parent/pom.xml
12
13
14
15
16
junit
17
junit
18
19
20 21

HelloFriend  pom.xml

1 
2
4.0.0
3 4
HelloFriend
5 6
HelloFriend
7 8
9
cn.itcast.maven
10
Parent
11
0.0.1-SNAPSHOT
12
../Parent/pom.xml
13
14
15
16
junit
17
junit
18
19
20
cn.itcast.maven
21
Hello
22
23
24

 

转载于:https://www.cnblogs.com/friends-wf/p/3825641.html

你可能感兴趣的文章
Windbg内核调试之二: 常用命令
查看>>
saltstack (3) grains 与 pillar
查看>>
shell 整理(27)===大小写字母替换修改文件名
查看>>
centos 安装 svn
查看>>
centos 7ftp服务器搭建
查看>>
火焰图之性能分析
查看>>
交换机上的三种端口模式
查看>>
新增一块磁盘,磁盘无法识别问题,无需重启主机
查看>>
mysql索引
查看>>
APP后端处理表情的一些技巧
查看>>
关系计划笔谈(9-2):鬼子要进村了,什么时候埋地雷?
查看>>
centos 中文支持设置
查看>>
PHPStudy开启rewrite_module重写功能启用.htaccess
查看>>
IsRectEmpty与IsRectNull
查看>>
make.exe: *** [obj/local/armeabi-v7a/libtest.so] Error 1
查看>>
Splunk 预测2018年人工智能和机器学习的三大趋势
查看>>
webluker刷新缓存-php版
查看>>
用saltstack cp模块实现文件管理
查看>>
HTML 快速入门
查看>>
Linux系统密钥验证(附件有实验过程和截图)
查看>>