简介
本文介绍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](依赖分析器)
点击[AllDependencies 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,找到了。
到此这篇关于 Intellij IDEA 根据maven依赖名查找它是哪个pom.xml引入的的文章就介绍到这了,更多相关idea maven依赖内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
原文地址:https://blog.csdn.net/feiying0canglang/article/details/126259520
查看更多关于Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)的详细内容...