@Override
  public @NotNull ArrayList<AddArtifactResponse> addArtifacts(@NotNull MavenIndexId indexId,
                                                              @NotNull ArrayList<File> artifactFiles,
                                                              MavenToken token) throws MavenServerIndexerException {
    MavenServerUtil.checkToken(token);
    try {
      IndexingContext context = getIndex(indexId);
      ArrayList<AddArtifactResponse> results = new ArrayList<>();
      synchronized (context) {
        for (File artifactFile : artifactFiles) {
          ArtifactContext artifactContext = myArtifactContextProducer.getArtifactContext(context, artifactFile);
          IndexedMavenId id = null;
          if (artifactContext != null) {
            myIndexer.addArtifactToIndex(artifactContext, context);
            //invalidateSearchersAndReadersCache
            ArtifactInfo a = artifactContext.getArtifactInfo();
            id = new IndexedMavenId(a.getGroupId(), a.getArtifactId(), a.getVersion(), a.getPackaging(), a.getDescription());
          }
          results.add(new AddArtifactResponse(artifactFile, id));
        }
      }
      return results;
    }
    catch (Exception e) {
      throw new MavenServerIndexerException(wrapException(e));
    }
  }
@Override
  public @NotNull ArrayList<AddArtifactResponse> addArtifacts(@NotNull MavenIndexId indexId,
                                                              @NotNull ArrayList<File> artifactFiles,
                                                              MavenToken token)