在Maven项目中查找依赖项(反向依赖项) [英] Find dependant (reverse dependencies) in maven project

查看:461
本文介绍了在Maven项目中查找依赖项(反向依赖项)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一个与mvn dependency:tree相反的命令.我想找出所有依赖特定模块的项目.听起来很琐碎,我找不到这种东西.

I'm trying to find a command that does the opposite of mvn dependency:tree. I want to find out all the projects that depend on a specific module. As trivial as it may sound, I couldn't find such thing.

用例是为了在一个非常大的项目中查找我是否可以删除一个模块,或者是否有其他模块将其用作依赖项.

The use case is in order to find, in a very large project, if I can delete a module or if there are other modules that use it as their dependency.

推荐答案

尝试一下:

mvn dependency:tree -Dincludes=module

其中module是您感兴趣的依赖项.您应该获得直接或传递依赖于您指定的模块的库的列表.

Where module is the dependency you're interested in. You should get the list of libraries that depend on the module you've specified, either directly or transitively.

这篇关于在Maven项目中查找依赖项(反向依赖项)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆