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

作者:IT利刃出鞘 时间:2023-07-20 07:49:35 

简介

本文介绍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,找到了。

来源:https://blog.csdn.net/feiying0canglang/article/details/126259520

标签:idea,maven,依赖,pom.xml
0
投稿

猜你喜欢

  • 获取Spring的上下文环境ApplicationContext的最简单方式

    2023-04-17 18:14:40
  • SpringBoot从yml配置文件中读常用参数值实例方法

    2021-07-01 11:12:04
  • C#下实现创建和删除目录的实例代码

    2021-10-21 16:04:31
  • java计算给定字符串中出现次数最多的字母和该字母出现次数的方法

    2022-01-13 03:00:04
  • 修改Maven settings.xml 后配置未生效的解决

    2023-07-06 22:17:03
  • C#通用邮件发送类分享

    2022-05-03 01:35:36
  • eclipse中自动生成javadoc文档的方法

    2022-04-08 17:54:12
  • Android日历控件PickTime代码实例

    2021-09-28 17:22:57
  • Android自定义DigitalClock控件实现商品倒计时

    2023-07-17 20:13:28
  • android中RecycleView添加下滑到底部的监听示例

    2022-06-21 17:02:08
  • 浅谈Java编程中string的理解与运用

    2021-05-31 22:15:44
  • Java多线程通信:交替打印ABAB实例

    2022-04-08 06:57:28
  • C#中using关键字的使用方法示例

    2023-07-30 14:17:02
  • Spring Security配置保姆级教程

    2023-11-07 11:46:56
  • C#实现带搜索功能的ComboBox

    2022-08-29 06:52:48
  • Java实现pdf转图片案例

    2022-08-11 21:45:41
  • C# 在PDF中添加墨迹注释Ink Annotation的步骤详解

    2022-01-31 14:23:29
  • C#基于DBContext(EF)实现通用增删改查的REST方法实例

    2021-06-23 20:56:07
  • Java中ArrayList与顺序表的概念与使用实例

    2023-01-09 03:50:30
  • 举例解析Java的设计模式编程中里氏替换原则的意义

    2021-06-30 18:37:17
  • asp之家 软件编程 m.aspxhome.com