private MavenProblemInfo installNewLiferayFacet(
      IFacetedProject facetedProject, MavenProject mavenProject, IProgressMonitor monitor) {
    MavenProblemInfo retval = null;

    final String pluginType = getLiferayMavenPluginType(mavenProject);
    final Plugin liferayMavenPlugin = LiferayMavenUtil.getLiferayMavenPlugin(mavenProject);
    final Action action = getNewLiferayFacetInstallAction(pluginType);

    if (action != null) {
      try {
        facetedProject.modify(Collections.singleton(action), monitor);
      } catch (Exception e) {
        final SourceLocation location = SourceLocationHelper.findLocation(liferayMavenPlugin, null);
        final String problemMsg =
            NLS.bind(
                Msgs.facetInstallError,
                pluginType,
                e.getCause() != null ? e.getCause().getMessage() : e.getMessage());

        retval = new MavenProblemInfo(location, e);
        retval.setMessage(problemMsg);

        LiferayMavenCore.logError(
            "Unable to install liferay facet " + action.getProjectFacetVersion(),
            e.getCause()); // $NON-NLS-1$
      }

      final IProject project = facetedProject.getProject();

      try {
        // IDE-817 we need to mak sure that on deployment it will have the correct suffix for
        // project name
        final IVirtualComponent projectComponent = ComponentCore.createComponent(project);

        if (projectComponent != null) {
          final String deployedName = projectComponent.getDeployedName();

          if (deployedName == null
              || (deployedName != null && !deployedName.endsWith(pluginType))) {
            final String deployedFileName = project.getName() + "-" + pluginType; // $NON-NLS-1$

            configureDeployedName(project, deployedFileName);
            projectComponent.setMetaProperty("context-root", deployedFileName); // $NON-NLS-1$
          }
        }
      } catch (Exception e) {
        LiferayMavenCore.logError(
            "Unable to configure component for liferay deployment." + project.getName(),
            e); //$NON-NLS-1$
      }
    }

    return retval;
  }