@NotNull
  private <R> R executeWithMavenEmbedderWrapper(Function<MavenEmbedderWrapper, R> function) {
    MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(myProject);
    MavenEmbeddersManager manager = projectsManager.getEmbeddersManager();
    String baseDir = "";
    List<MavenProject> projects = projectsManager.getRootProjects();
    if (!projects.isEmpty()) {
      baseDir = MavenUtil.getBaseDir(projects.get(0).getDirectoryFile()).toString();
    }
    MavenEmbedderWrapper mavenEmbedderWrapper = manager.getEmbedder(FOR_POST_PROCESSING, baseDir);
    try {
      return function.apply(mavenEmbedderWrapper);
    }
    finally {
      manager.release(mavenEmbedderWrapper);
    }
  }
@NotNull
  private <R> R executeWithMavenEmbedderWrapper(Function<MavenEmbedderWrapper, R> function)