获取已解决的依赖项
Collections.UnmodifiableSet set = (Collections.UnmodifiableSet) project
.getConfigurations()
.getByName("releaseRuntimeClasspath")
.getIncoming()
.getResolutionResult()
.getRoot()
.getDependencies();
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
DependencyResult next = (DependencyResult) iterator.next();
//输出
}
获取为解决的依赖项:
Collections.UnmodifiableSet set = (Collections.UnmodifiableSet) project
.getConfigurations()
.getByName("releaseRuntimeClasspath")
.getAllDependencies();