如何查找缺少的Maven依赖项 [英] How to find which maven dependencies are missing
问题描述
我有一个Web项目和一个pom.xml
文件.它对compile
和package
具有足够的依赖性,但不足以启动项目.在我的IDE中,显示一切正常,但是启动应用程序时出现错误.当我从另一个应用程序添加外部pom.xml时,我的应用程序启动.
I have a web project and a pom.xml
file. It has enough dependencies to compile
and package
but not enough to start the project. In my IDE it's shown that everything is ok, but when a start the application it has errors. When i add external pom.xml from another app, my application launches.
那么,有什么方法可以找出缺少的依赖项,以及将来如何确定使用此依赖项所需的依赖项?
So is there any way i can find out which dependencies are missing and how in future i can determine which dependencies are needed for using this or that?
推荐答案
您可以使用mvn dependency:analyze
来确定哪些依赖项是used and declared
或used and undeclared
或unused and declared
.
有关更多信息,请参考: http://maven.apache.org /plugins/maven-dependency-plugin/analyze-mojo.html .
You can use mvn dependency:analyze
for determining which dependencies are used and declared
or used and undeclared
or unused and declared
.
For more information refer to: http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html.
希望这会有所帮助.
这篇关于如何查找缺少的Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!