private static @Nullable Path createVerificationProblemReport(@NotNull CompileContext context,
                                                                @NotNull String libraryName,
                                                                @NotNull JpsMavenRepositoryLibraryDescriptor descriptor,
                                                                @NotNull String problemKind,
                                                                @NotNull Consumer<Properties> metadataWriter) {
    String outputDirPath = System.getProperty(RESOLUTION_CORRUPTED_ARTIFACTS_REPORTS_DIRECTORY_PROPERTY, null);
    if (outputDirPath == null) {
      return null;
    }
    PathRelativizerService relativizerService = context.getProjectDescriptor().dataManager.getRelativizer();
    Path corruptedArtifactsReportsDir = Path.of(relativizerService.toFull(outputDirPath));

    Path libraryReportDir;
    try {
      Files.createDirectories(corruptedArtifactsReportsDir);
      libraryReportDir = Files.createTempDirectory(corruptedArtifactsReportsDir, problemKind + "_");
    } catch (IOException e) {
      throw new RuntimeException("Failed to create reports directory", e);
    }

    Properties metadata = new Properties();
    metadata.setProperty("libraryName", libraryName);
    metadata.setProperty("mavenId", descriptor.getMavenId());
    metadata.setProperty("problem", problemKind);
    metadataWriter.accept(metadata);

    try {
      Path artifactCopyDescriptionPath = Files.createFile(libraryReportDir.resolve("report.properties"));
      try (OutputStream os = Files.newOutputStream(artifactCopyDescriptionPath)) {
        metadata.store(os, null);
      }
    }
    catch (IOException e) {
      throw new RuntimeException("Failed to write report.properties", e);
    }
    return libraryReportDir;
  }
private static @Nullable Path createVerificationProblemReport(@NotNull CompileContext context,
                                                                @NotNull String libraryName,
                                                                @NotNull JpsMavenRepositoryLibraryDescriptor descriptor,
                                                                @NotNull String problemKind,
                                                                @NotNull Consumer<Properties> metadataWriter)