我正在尝试使用以太获取 Maven Artifact 的依赖项。我看到一个 RepositorySystem.collectDependencies(),但它只获取编译和运行时范围的依赖项。如何获取 Artifact 的所有依赖项,包括测试和提供?
最佳答案
看看jcabi-aether (我是开发人员),它是 Sonatype Aether 的包装器:
File repo = this.session.getLocalRepository().getBasedir();
Collection<Artifact> deps = new Aether(this.getProject(), repo).resolve(
new DefaultArtifact("junit", "junit-dep", "", "jar", "4.10"),
JavaScopes.RUNTIME
);
关于maven - 如何使用以太获取所有 Maven 依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15094751/