maven 总结

maven 对jar包的依赖有先后顺序,用父pom 管理子pom 在父类中引用了包(dependency加入了版本号) 子类中引用的时候版本号就不需要要了

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
为了上下工程统一,则父工程用到的版本是4.1.17版本,子工程在引用的时候依赖关系的版本号就删掉即可
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>
 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值