@Nullable
  @Override
  public HashMap<String, String> resolveAndGetArchetypeDescriptor(@NotNull String groupId, @NotNull String artifactId,
                                                              @NotNull String version,
                                                              @NotNull ArrayList<MavenRemoteRepository> repositories,
                                                              @Nullable String url, MavenToken token) throws RemoteException {
    MavenServerUtil.checkToken(token);
    try {
      MavenExecutionRequest request = createRequest(null, null, null);
      List<ArtifactRepository> artifactRepositories = map2ArtifactRepositories(repositories);
      for (ArtifactRepository repository : artifactRepositories) {
        request.addRemoteRepository(repository);
      }

      HashMap<String, String> result = new HashMap<>();
      AtomicBoolean unknownArchetypeError = new AtomicBoolean(false);
      executeWithMavenSession(request, () -> {
        MavenArtifactRepository artifactRepository = null;
        if (url != null) {
          artifactRepository = new MavenArtifactRepository();
          artifactRepository.setId("archetype");
          artifactRepository.setUrl(url);
          artifactRepository.setLayout(new DefaultRepositoryLayout());
        }

        List<ArtifactRepository> remoteRepositories = request.getRemoteRepositories();

        ArchetypeArtifactManager archetypeArtifactManager = getComponent(ArchetypeArtifactManager.class);
        ArchetypeDescriptor descriptor = null;
        try {
          descriptor = archetypeArtifactManager.getFileSetArchetypeDescriptor(
            groupId, artifactId, version, artifactRepository,
            getLocalRepository(), remoteRepositories);
        }
        catch (UnknownArchetype e) {
          unknownArchetypeError.set(true);
        }
        if (descriptor != null && descriptor.getRequiredProperties() != null) {
          for (RequiredProperty property : descriptor.getRequiredProperties()) {
            result.put(property.getKey(), property.getDefaultValue() != null ? property.getDefaultValue() : "");
          }
        }
      });
      return unknownArchetypeError.get() ? null : result;
    }
    catch (Exception e) {
      throw wrapToSerializableRuntimeException(e);
    }
  }
@Nullable
  @Override
  public HashMap<String, String> resolveAndGetArchetypeDescriptor(@NotNull String groupId, @NotNull String artifactId,
                                                              @NotNull String version,
                                                              @NotNull ArrayList<MavenRemoteRepository> repositories,
                                                              @Nullable String url, MavenToken token)