Java代码获取Maven依赖图

标签 java eclipse maven dependencies aether

我正在开发的程序的要求之一是我需要能够查看存储库中多个 Artifact 的 Maven 依赖关系,以便我可以为它们创建依赖关系图。虽然 Maven 和 Eclipse Aether 显然可以做到这一点(因为 Maven 的很大一部分是获取依赖项),但我在弄清楚如何在 Java 程序中做到这一点上遇到了很大的困难。

有什么建议吗?

最佳答案

根据documentation,Aether 似乎可以提供帮助。 。甚至还有an example that demonstrates how to use Aether to collect the transitive dependencies of an artifact 。将其与 Maven API example here 结合起来,我想你可以到达你想要的地方。

关于Java代码获取Maven依赖图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30895725/

相关文章:

java - JAX-RS 注释 : Better to put on Interfaces or Classes?

java - 如何从查询中返回int?

java - 如何在eclipse中使用JPA工具为smallint类型列生成短变量?

maven - 我应该在我的 pom.xml 中编写存储库吗?

java - Spring Maven 应用程序中的单个无状态 Servlet

java - 执行 Maven archetype generate 命令创建 Opendaylight 项目结构时出错

java - 有谁知道如何找到 google-api-java-client 的最新 javadocs

java - DataNucleus Enhancer 能否处理类路径中 jar 中的类?

eclipse - SVN/Subclipse 过期 SSL 证书错误

eclipse - 在 Eclipse 中向工具栏添加/重新添加按钮?