public static void loadArtifactsFromDirectory(@NotNull JpsProject project,
                                                @NotNull JpsComponentLoader componentLoader,
                                                @NotNull Path dir,
                                                @Nullable Path externalConfigDir) {
    Runnable artifactsTimingLog = TimingLog.startActivity("loading artifacts");
    for (Path artifactFile : listXmlFiles(dir.resolve("artifacts"))) {
      @Nullable Element artifactManagerComponent = componentLoader.loadRootElement(artifactFile);
      JpsArtifactSerializer.loadArtifacts(project, artifactManagerComponent);
    }
    if (externalConfigDir != null) {
      @Nullable Element artifactManagerComponent = componentLoader.loadRootElement(externalConfigDir.resolve("artifacts.xml"));
      JpsArtifactSerializer.loadArtifacts(project, artifactManagerComponent);
    }
    artifactsTimingLog.run();
  }
public static void loadArtifactsFromDirectory(@NotNull JpsProject project,
                                                @NotNull JpsComponentLoader componentLoader,
                                                @NotNull Path dir,
                                                @Nullable Path externalConfigDir)