Maven-如何验证声明的存储库中的依赖项是否可用?
我刚刚为项目编辑了pom.xml
文件的<repositories />
部分,删除了一些我认为不需要的回购代码.
I have just edited the <repositories />
section of my pom.xml
file for a project, removing a couple of repo's I thought were unneeded.
我想验证声明的依赖项在可用存储库中仍可解析.
I'd like to validate that the declared dependencies are still resolvable in the available repositories.
但是,所有声明的依赖项在我的本地存储库中都是可用的,因此任何构建尝试都将只使用本地的依赖项.
However, all of the declared dependencies are available in my local repo, so any attempt to build will just use the local ones.
我不想简单地核对我的本地存储库,因为从头开始下载所有依赖项要花费很多时间.
I don't want to simply nuke my local repo, as it takes many hours to download all the dependencies from scratch.
类似地,我对Maven尝试下载所有依赖项不感兴趣,我只是希望它确保它们都是可解析的(包括传递性依赖项).
Similarly, I'm not interested in having maven attempt to download all the dependencies, I just want it to ensure that they're all resolvable (including transitive dependencies).
我该怎么做?
运行
mvn dependency:analyze
它将为您检查依赖关系.
it will check dependencies for you.
参考: http://maven.apache.org/plugins/maven-dependency -plugin/analyze-mojo.html