use of demo.util.ConsoleDependencyGraphDumper in project sonatype-aether by sonatype.
the class GetDependencyTreeWithMirror method main.
public static void main(String[] args) throws Exception {
System.out.println("------------------------------------------------------------");
System.out.println(GetDependencyTreeWithMirror.class.getSimpleName());
RepositorySystem system = Booter.newRepositorySystem();
RepositorySystemSession session = Booter.newRepositorySystemSession(system);
Artifact artifact = new DefaultArtifact("org.apache.maven:maven-aether-provider:3.0.2");
RemoteRepository central = new RemoteRepository("central", "default", "http://repo1.maven.org/maven2/");
DefaultMirrorSelector dms = (DefaultMirrorSelector) session.getMirrorSelector();
dms.add("mirror", "http://repo1.maven.org/maven2/", "default", true, "central", "*");
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(artifact, ""));
collectRequest.addRepository(central);
CollectResult collectResult = system.collectDependencies(session, collectRequest);
collectResult.getRoot().accept(new ConsoleDependencyGraphDumper());
}
use of demo.util.ConsoleDependencyGraphDumper in project sonatype-aether by sonatype.
the class Aether method displayTree.
private void displayTree(DependencyNode node, StringBuilder sb) {
ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
node.accept(new ConsoleDependencyGraphDumper(new PrintStream(os)));
sb.append(os.toString());
}
use of demo.util.ConsoleDependencyGraphDumper in project sonatype-aether by sonatype.
the class GetDependencyTree method main.
public static void main(String[] args) throws Exception {
System.out.println("------------------------------------------------------------");
System.out.println(GetDependencyTree.class.getSimpleName());
RepositorySystem system = Booter.newRepositorySystem();
RepositorySystemSession session = Booter.newRepositorySystemSession(system);
Artifact artifact = new DefaultArtifact("org.apache.maven:maven-aether-provider:3.0.2");
RemoteRepository repo = Booter.newCentralRepository();
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(artifact, ""));
collectRequest.addRepository(repo);
CollectResult collectResult = system.collectDependencies(session, collectRequest);
collectResult.getRoot().accept(new ConsoleDependencyGraphDumper());
}
Aggregations