@Test public void testBuildLinkageCheckDependencyGraph_catchRootException() { DependencyGraph result = dependencyGraphBuilder.buildFullDependencyGraph( ImmutableList.of(new DefaultArtifact("ant:ant:jar:1.6.2"))); Set<UnresolvableArtifactProblem> problems = result.getUnresolvedArtifacts(); Truth.assertThat(problems) .comparingElementsUsing(problemOnArtifact) .containsAtLeast("xerces:xerces-impl:2.6.2", "xml-apis:xml-apis:2.6.2"); Truth.assertThat(problems).hasSize(2); Truth.assertThat(problems) .comparingElementsUsing( Correspondence.transforming(UnresolvableArtifactProblem::toString, "has description")) .containsExactly( "xerces:xerces-impl:jar:2.6.2 was not resolved. Dependency path: ant:ant:jar:1.6.2" + " (compile) > xerces:xerces-impl:jar:2.6.2 (compile?)", "xml-apis:xml-apis:jar:2.6.2 was not resolved. Dependency path: ant:ant:jar:1.6.2" + " (compile) > xml-apis:xml-apis:jar:2.6.2 (compile?)"); }
public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(Artifact artifact); DependencyGraph buildMavenDependencyGraph(Dependency dependency); }
DependencyGraphBuilder { public DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts) { ImmutableList<DependencyNode> dependencyNodes = artifacts.stream().map(DefaultDependencyNode::new).collect(toImmutableList()); DefaultRepositorySystemSession session = RepositoryUtility.newSessionForFullDependency(system); return buildDependencyGraph(dependencyNodes, session); } DependencyGraphBuilder();  DependencyGraphBuilder(Iterable<String> mavenRepositoryUrls); DependencyGraph buildFullDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(List<Artifact> artifacts); DependencyGraph buildVerboseDependencyGraph(Artifact artifact); DependencyGraph buildMavenDependencyGraph(Dependency dependency);  }