Intellij IDEA--根据maven依赖名查找它是哪个pom.xml引入的

简介

本文介绍Idea如何根据maven依赖名查找它是哪个pom.xml引入的。

有时候会有这样的问题:我们知道项目里用了某个依赖,想知道它是项目里哪个pom.xml引入的,这样可以进行修改版本、更新依赖等操作。

示例

需求:有个分布式项目,想确定订单微服务(order-core)里使用的feign是哪个pom.xml引入的。

1. Idea安装maven helper插件

2.在order-core的pom.xml里查找

打开order-core的pom.xml

点击“Dependencies Analyzer”(依赖分析器)

点击“All Dependencies As List”(列表形式显示依赖)

搜索“feign”,点击“feign-core",在右侧可以看到依赖结构,发现最顶层依赖是”spring-cloud-starter-openfeign“。

点击“spring-cloud-starter-openfeign”

可以看到,本pom.xml(order-core)、account-api、storage-api都引入了 “spring-cloud-starter-openfeign”

3.找本层(order-core)的pom.xml

可以看到,本层没有引入“spring-cloud-starter-openfeign”。

4.找上层的pom.xml

找“account-api”和“storage-api”的pom.xml

可以看到,“account-api”和“storage-api”都没有引入“spring-cloud-starter-openfeign”

5.找上上层的pom.xml

“account-api”和“storage-api”都以此pom.xml为父级:…/…/…/parent/parent-api/pom.xml

OK,找到了。

欢迎关注我的公众号:敲代码的老贾,回复“领取”赠送《Java面试》资料,阿里,腾讯,字节,美团,饿了么等大厂

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值