code: private static DependencyDescriptor asDescriptor(String scope, ResolvedArtifact artifact) {
          ModuleVersionIdentifier id = artifact.getModuleVersion().getId();
          return new DefaultDependencyDescriptor(scope, id.getGroup(), id.getName(), id.getVersion(),
                                                 artifact.getType(), artifact.getClassifier(), artifact.getFile());
      }
docs: Translate the given {@link ResolvedArtifact resolved artifact} in to a {@link DependencyDescriptor} reference.
  
  @param scope    the scope to assign to the descriptor.
  @param artifact the resolved artifact reference.
  @return an instance of {@link DependencyDescriptor}.