private static @NotNull Map<String, Set<File>> collectProjectConfigurationArtifacts(
    @NotNull Project project,
    @NotNull ModelBuilderContext context
  ) {
    Map<String, Set<File>> configurationArtifacts = new HashMap<>();
    GradleCollectionVisitor.accept(project.getConfigurations(), new GradleCollectionVisitor<Configuration>() {

      @Override
      public void visit(Configuration element) {
        PublishArtifactSet artifactSet = element.getArtifacts();
        FileCollection fileCollection = artifactSet.getFiles();
        Set<File> files = fileCollection.getFiles();
        configurationArtifacts.put(element.getName(), new LinkedHashSet<>(files));
      }

      @Override
      public void onFailure(Configuration element, @NotNull Exception exception) {
        context.getMessageReporter().createMessage()
          .withGroup(Messages.SOURCE_SET_MODEL_PROJECT_CONFIGURATION_ARTIFACT_GROUP)
          .withTitle("Project configuration error")
          .withText("Cannot resolve an artifact file for the project configuration" + element)
          .withKind(Message.Kind.WARNING)
          .withException(exception)
          .reportMessage(project);
      }

      @Override
      public void visitAfterAccept(Configuration element) {
        context.getMessageReporter().createMessage()
          .withGroup(Messages.SOURCE_SET_MODEL_SKIPPED_PROJECT_CONFIGURATION_ARTIFACT_GROUP)
          .withTitle("Project configuration error")
          .withText("Artifact files collecting for project configurations was finished. " +
                    "Resolution for the configuration " + element + " will be skipped.")
          .withInternal().withStackTrace()
          .withKind(Message.Kind.WARNING)
          .reportMessage(project);
      }
    });
    return configurationArtifacts;
  }
private static @NotNull Map<String, Set<File>> collectProjectConfigurationArtifacts(
    @NotNull Project project,
    @NotNull ModelBuilderContext context
  )