private static @NotNull DefaultExternalLibraryDependency resolveLibraryDependency(
    @NotNull ResolvedArtifact artifact,
    @NotNull File artifactFile,
    @NotNull Map<ComponentIdentifier, ComponentArtifactsResult> auxiliaryArtifactsMap
  ) {
    DefaultExternalLibraryDependency libraryDependency = new DefaultExternalLibraryDependency();

    ModuleVersionIdentifier moduleVersionIdentifier = artifact.getModuleVersion().getId();
    libraryDependency.setName(moduleVersionIdentifier.getName());
    libraryDependency.setGroup(moduleVersionIdentifier.getGroup());
    libraryDependency.setVersion(moduleVersionIdentifier.getVersion());
    libraryDependency.setFile(artifactFile);

    ComponentIdentifier componentIdentifier = artifact.getId().getComponentIdentifier();
    ComponentArtifactsResult artifactsResult = auxiliaryArtifactsMap.get(componentIdentifier);
    if (artifactsResult != null) {
      Set<File> sourcesArtifactFiles = getResolvedAuxiliaryArtifactFiles(artifactsResult, SourcesArtifact.class);
      File sourcesFile = chooseAuxiliaryArtifactFile(artifactFile, sourcesArtifactFiles);
      if (sourcesFile != null) {
        libraryDependency.setSource(sourcesFile);
      }
      Set<File> javadocArtifactFiles = getResolvedAuxiliaryArtifactFiles(artifactsResult, JavadocArtifact.class);
      File javadocFile = chooseAuxiliaryArtifactFile(artifactFile, javadocArtifactFiles);
      if (javadocFile != null) {
        libraryDependency.setJavadoc(javadocFile);
      }
    }
    if (artifact.getExtension() != null) {
      libraryDependency.setPackaging(artifact.getExtension());
    }
    libraryDependency.setClassifier(artifact.getClassifier());

    return libraryDependency;
  }
private static @NotNull DefaultExternalLibraryDependency resolveLibraryDependency(
    @NotNull ResolvedArtifact artifact,
    @NotNull File artifactFile,
    @NotNull Map<ComponentIdentifier, ComponentArtifactsResult> auxiliaryArtifactsMap
  )