private boolean createPluginXml(@NotNull ProjectId projectId, @NotNull Module module, @NotNull String contentRootPath) {
    try {
      VirtualFile metaInf = VfsUtil.createDirectoryIfMissing(contentRootPath + META_INF_PATH);
      if (metaInf == null) {
        return false;
      }
      if (metaInf.findChild(PluginManagerCore.PLUGIN_XML) != null) {
        return true;
      }
      Project project = module.getProject();
      VirtualFile pluginXml = metaInf.createChildData(this, PluginManagerCore.PLUGIN_XML);
      FileTemplateManager templateManager = FileTemplateManager.getInstance(project);
      FileTemplate template = templateManager.getJ2eeTemplate("gradleBasedPlugin.xml");

      @NonNls Map<String, String> attributes = new HashMap<>();
      String groupId = projectId.getGroupId();
      String artifactId = projectId.getArtifactId();
      if (StringUtil.isNotEmpty(artifactId)) {
        attributes.put("PLUGIN_ID", StringUtil.isNotEmpty(groupId) ? groupId + "." + artifactId : artifactId);
      }
      else {
        attributes.put("PLUGIN_ID", project.getName());
      }

      VfsUtil.saveText(pluginXml, template.getText(attributes));
      StartupManager.getInstance(project).runWhenProjectIsInitialized(() -> {
        FileEditorManager.getInstance(project).openFile(pluginXml, true);
      });
      return true;
    }
    catch (IOException e) {
      LOG.error(e);
      return false;
    }
  }
private boolean createPluginXml(@NotNull ProjectId projectId, @NotNull Module module, @NotNull String contentRootPath)