maven继承管理 让版本的管理只在一个地方改变
modules用于聚合,把执行的项目都放到同一的地方用module包括,可以省去一个个项目去mvn install,这样可以所有项目一次聚合 mvn install
传递性依赖原则:
A-->B
A-->C1.路径最近者优先
2.路径相同,第一声明者优先注意:
1.dependencyManagement中定义的依赖子module不会共享2.dependencies中定义的依赖子module可以共享
dependencyManagement的使用 就是方便管理版本,子项目中要引入group id和atifact id
在parent项目的pom.xml配置
13 4.0.0 4 5cn.itcast.maven 6Parent 70.0.1-SNAPSHOT 8pom 9 10Parent 11http://maven.apache.org 12 1314 19 20../Hello 15../HelloFriend 16../MakeFriends 17../Web 1821 23 24 25UTF-8 2226 27 28 53 5429 5230 35junit 31junit 324.9 33test 3436 41cn.itcast.maven 37Hello 380.0.1-SNAPSHOT 39compile 4042 46cn.itcast.maven 43HelloFriend 440.0.1-SNAPSHOT 4547 51cn.itcast.maven 48MakeFriends 490.0.1-SNAPSHOT 5055 66 67 6856 60releases 57Internal Releases 58http://localhost:8080/nexus-2.1.2/content/repositories/releases/ 5961 65snapshots 62Internal Snapshots 63http://localhost:8080/nexus-2.1.2/content/repositories/snapshots/ 64
Hello.pom
12 4.0.0 3 4Hello 5 6 78 13cn.itcast.maven 9Parent 100.0.1-SNAPSHOT 11../Parent/pom.xml 1214 15 20 2116 19junit 17junit 18
HelloFriend pom.xml
12 4.0.0 3 4HelloFriend 5 6HelloFriend 7 89 14cn.itcast.maven 10Parent 110.0.1-SNAPSHOT 12../Parent/pom.xml 1315 2416 19junit 17junit 1820 23cn.itcast.maven 21Hello 22