private static ArtifactRepositoryManager getRepositoryManager(@NotNull CompileContext context,
                                                                @NotNull JpsMavenRepositoryLibraryDescriptor descriptor,
                                                                @NotNull String libraryName,
                                                                boolean useBindRepositories) throws RemoteRepositoryNotFoundException {
    if (!useBindRepositories) return getRepositoryManager(context);

    String repositoryId = descriptor.getJarRepositoryId();
    if (repositoryId == null) {
      throw new RemoteRepositoryNotFoundException(JpsBuildBundle.message("build.message.error.bind.repository.missing", libraryName));
    }
    return getRepositoryManager(context, repositoryId);
  }
private static ArtifactRepositoryManager getRepositoryManager(@NotNull CompileContext context,
                                                                @NotNull JpsMavenRepositoryLibraryDescriptor descriptor,
                                                                @NotNull String libraryName,
                                                                boolean useBindRepositories)