服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - Java教程 - Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

2022-08-20 14:28IT利刃出鞘 Java教程

这篇文章主要介绍了Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的,本文通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

简介

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

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

 

示例

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

 

1. Idea安装maven helper插件

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

 

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

打开order-core的pom.xml

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

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

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

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

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

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

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

点击“spring-cloud-starter-openfeign”

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

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

 

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

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

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

 

4.找上层的pom.xml

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

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

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

 

5.找上上层的pom.xml

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

Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的(图文详解)

OK,找到了。

到此这篇关于Intellij IDEA根据maven依赖名查找它是哪个pom.xml引入的的文章就介绍到这了,更多相关idea maven依赖内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文地址:https://blog.csdn.net/feiying0canglang/article/details/126259520

延伸 · 阅读

精彩推荐