Developing Liferay Faces Portlets with Maven

If you’re unfamiliar with the Liferay Faces project, it’s important to know that Liferay Faces is an umbrella project that provides support for the JavaServer Faces (JSF) standard in Liferay Portal. Thus, Liferay Faces portlets and JSF portlets are closely related. Visit the JSF-related learning path for further details on JSF portlets and the Liferay Faces project.

This tutorial explains the Liferay Faces portlets generation process using Maven, and the anatomy of a JSF portlet.

You’ll begin creating a Liferay Faces portlet plugin next.

Creating a Liferay Faces Portlet Plugin

To create your Liferay Faces portlet plugin project, follow the Creating Liferay Maven Plugins from Liferay IDE tutorial or the Creating Liferay Maven Plugins from the Command Line tutorial, making sure to select Portlet as the plugin type and JSF 2.x as the portlet framework. Lastly, you’ll be required to select a JSF component suite.

A Liferay Faces portlet can be built to use one of several different JSF component suites, including RichFaces, PrimeFaces, Liferay Faces Alloy, the JSF Standard suite, and ICEfaces. Each JSF component suite has an archetype that is used in creating the portlet.

It’s helpful to familiarize yourself with a Liferay Faces portlet plugin project’s directory structure. You can explore its anatomy next.


A portlet project created from the com.liferay.maven.archetypes:liferay-portlet-jsf-archetype has the following directory structure:

  • jsf-portlet-plugin/
    • src/
      • main/
        • java/
        • resources/
          • Language_[locale].properties
        • webapp/
          • css/
            • main.css
          • views/
            • view.xhtml
          • WEB-INF/
            • faces-config.xml
            • liferay-display.xml
            • liferay-hook.xml
            • liferay-portlet.xml
            • portlet.xml
            • web.xml
            • weblogic.xml
          • icon.png
    • pom.xml

Maven creates the src/main/java/ directory automatically. It holds the portlet’s Java source code (e.g.,, and portlet-plugin/src/main/webapp holds its web source code. If you’ve created any portlet plugins using the Plugins SDK, you might have noted it uses a different directory structure.

The following table illustrates the differences in the locations of the Java source code and web source code for a Maven project and a Plugins SDK project:

Location | Maven project | Plugins SDK project | ———– | —————– | ——————— | Java source | src/main/java | docroot/WEB-INF/src | Web source | src/main/webapp | docroot |

Congratulations! You now know how to create Liferay Faces portlets that can leverage one of several powerful JSF frameworks.

JSF Portlets with Liferay Faces

Developing Liferay Plugins with Additional Maven Archetypes

Deploying Liferay Plugins with Maven

« Developing Liferay Layout Template Plugins with MavenDeveloping Liferay Plugins with Additional Maven Archetypes »
Was this article helpful?
0 out of 0 found this helpful