本文整理汇总了Java中org.eclipse.aether.graph.DependencyVisitor类的典型用法代码示例。如果您正苦于以下问题:Java DependencyVisitor类的具体用法?Java DependencyVisitor怎么用?Java DependencyVisitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DependencyVisitor类属于org.eclipse.aether.graph包,在下文中一共展示了DependencyVisitor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.eclipse.aether.graph.DependencyVisitor; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
classLoaderResolver = new ClassLoaderResolver(log, repositorySystem, repositorySystemSession, Collections.<RemoteRepository>emptyList());
when(repositorySystem.collectDependencies(eq(repositorySystemSession), any(CollectRequest.class)))
.thenReturn(new CollectResult(new CollectRequest()).setRoot(root));
when(child.getDependency()).thenReturn(new Dependency(new DefaultArtifact(FOO,
BAR,
QUX,
BAZ,
FOO + BAR,
Collections.<String, String>emptyMap(),
new File(FOO + "/" + BAR)), QUX + BAZ));
when(root.accept(any(DependencyVisitor.class))).then(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
DependencyVisitor dependencyVisitor = invocationOnMock.getArgument(0);
dependencyVisitor.visitEnter(child);
dependencyVisitor.visitLeave(child);
return null;
}
});
}
示例2: generateBuildRules
import org.eclipse.aether.graph.DependencyVisitor; //导入依赖的package包/类
public static Set<MavenJarRule> generateBuildRules(DependencyNode root) {
MutableGraph<MavenJarRule> graph = GraphBuilder.directed().allowsSelfLoops(false).build();
DependencyVisitor visitor = new AetherGraphTraverser(graph);
root.getChildren().forEach(c -> c.accept(visitor));
return graph.nodes();
}
示例3: addDependencyVisitor
import org.eclipse.aether.graph.DependencyVisitor; //导入依赖的package包/类
public void addDependencyVisitor(DependencyVisitor visitor) {
this.additionalVisitors.add(visitor);
}
示例4: LogDependencyVisitor
import org.eclipse.aether.graph.DependencyVisitor; //导入依赖的package包/类
public LogDependencyVisitor(Log out, DependencyVisitor visitor) {
this.out = out;
this.visitor = visitor;
}