maven 总结
maven 對jar包的依賴有先后順序,用父pom 管理子pom 在父類中引用了包(dependency加入了版本號) 子類中引用的時(shí)候版本號就不需要要了
maven 用包是就近原則
eg:我父工程(sun)的pom用到了netty包引入的是
<dependency><groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.7.Final</version>
</dependency>
我子工程(moon-service)pom用到了netty包引入的是 <dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.0.18.Final</version>
</dependency>
則在子工程中用到的netty包的版本就是4.0.18
為了上下工程統(tǒng)一,則父工程用到的版本是4.1.17版本,子工程在引用的時(shí)候依賴關(guān)系的版本號就刪掉即可
eg:
父工程 <dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.7.Final</version>
</dependency>
子工程
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency> ?
總結(jié)
- 上一篇: 非农日汇市如何交易?美元脆弱性加剧,欧元
- 下一篇: 图的基本操作实现(数据结构实验)