code: private DependencyNode toDependencyNode(ProjectBuildingRequest buildingRequest, DependencyNode parent,
              org.apache.maven.model.Dependency dependency) throws ArtifactResolverException {
  
          final DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
  
          coordinate.setGroupId(dependency.getGroupId());
          coordinate.setArtifactId(dependency.getArtifactId());
          coordinate.setVersion(dependency.getVersion());
  
          final ArtifactType type = session.getRepositorySession().getArtifactTypeRegistry().get(dependency.getType());
          coordinate.setExtension(type.getExtension());
          coordinate.setClassifier(type.getClassifier());
  
          final Artifact artifact = artifactResolver.resolveArtifact(buildingRequest, coordinate).getArtifact();
  
          artifact.setScope(dependency.getScope());
  
          final DefaultDependencyNode node = new DefaultDependencyNode(parent, artifact, dependency.getVersion(), dependency.getScope(), null);
  
          return node;
  
      }
docs: Converts the dependency to a dependency node object.
  
  @param buildingRequest the Maven project building request
  @param parent the parent node
  @param dependency the dependency to convert
  @return the resulting dependency node
  @throws ArtifactResolverException thrown if the artifact could not be
  retrieved