In this post we will see how to create and deploy JSF Liferay Portlet on Tomcat server. We will use Maven to build the Portlet project.

There are some prerequisites to properly accomplish this tutorial.


  1. Having an Eclipse IDE with Liferay Plugin installed or a Liferay IDE
  2. Having Tomcat Server configured to use Liferay with JSF

You can start the tutorial when these two prerequisites are respected.

1- Creating a Liferay Portlet using the Liferay plugin wizard

First of all, we have to create a Liferay Plugin Project that will contain our JSF Liferay Portlet. Follow these instructions:

  1. On your Liferay IDE or Eclipse IDE, click on : File -> New -> Liferay Portlet
    Eclipse wizard to create JSF LIferay portlet
  2. If a pop up window is opened asking you to open a new Liferay Plugin Project Wizard, click “Yes
    Create JSF Liferay portlet eclipse popup
  3. The next window concerns the Liferay Plugin Project information. We will give a name to our Liferay project and choose Maven as a build type.
    – On project name, type : helloWorldPortlet
    – Choose Maven (Liferay-maven-plugin) as “Build type”
    – Fill the Maven project “group id” field with : com.roufid.examples
    Verify that the information entered correspond to the next image and click next
    Create JSF Liferay Portlet
  4. We will create a JSF Liferay Portlet, so on the next window, Select JSF2.x as portlet framework and lets the other information by default and click next
    Create JSF Liferay Portlet
  5. The next screen is to select a JSF Component Suite. Personally, I prefer work with Primefaces.  Choose the JSF component Suite you want, we will use PrimeFaces in this tutorial
    Create JSF Liferay Portlet
  6. Click finish
  7. If the “Open Associated Perspective ?” pop-up show up, select “No

Your JSF Portlet is now created but has some errors that we have to fix. These errors are due to the absence of the required Maven dependencies and the missing of the necessary Liferay profile.

2- Fixing Maven errors

Follow these steps to fix the Maven errors

  1.  Open the “Markers” view where you will see the errors
    create liferay jsf portlet
  2. First of all, do a maven update on your Liferay Plugin Project by: Right-click on your project -> Maven -> Update project (Alt+F5). Select “Force Update of Snapshots/Releases” and press “Ok
    This will download the dependencies from the maven repositories.
  3.  After downloading the Maven dependencies, only two errors will remain on the “Markers” view
    create liferay jsf portlet
  4. Click on the first error under “Maven Configuration Problem” and Quick fix it by : right-click and chose Quick-fix (CTRL+1)
    create liferay jsf portlet
  5. On the Quick fix pop up window, select “Create a new maven profile based on a Liferay runtime” and click “Finish
    create liferay jsf portlet
  6. Select your Liferay runtime and The “Liferay Version” field will be filled automatically. If not, put your Liferay version. In My case is “6.2.5”. Give an Id to your Maven Profile and keep Project pom.xml selected and press ok as the following image :
    Create and deploy JSF Liferay Portlet
  7. A new Profile will appear in your pom.xml. This profile will used by the maven-liferay-plugin to deploy the Portlet
  8. Normally, all your errors will disappear. If not, do a update maven on your Liferay Plugin Project: Right-click -> Maven -> Update project (Alt+f5)

Your JSF Portlet is now configured and ready to be deployed on the Liferay Portal. Now, we will deploy the Liferay Portlet to the Tomcat server.

3- Deployment of the JSF Liferay Portlet on the Tomcat Server

  1. Start your tomcat server
    create liferay jsf portlet - Starting tomcat server
  2. Wait for the start. A new window will open in your default browser. If not, go to http://localhost:8080/
  3. Sign in your portal Liferay. The Default Login and password are :
    Login :
    Password : test
    create jsf liferay portlet - Sign in Liferay portalyou will connect as Power User
  4. You will be redirected to the default Liferay landing page
  5. Go back to your Tomcat server, right-click on it and choose “add and remove
    create jsf liferay portlet - Deploying the Liferay porlet on Tomcat
  6. Select your JSF Liferay Portlet and click on “add” and next click “Finish
    create jsf liferay portlet
  7. Your portlet will automatically be deployed on your tomcat server. Wait for the deployment and go back to your browser
  8. Click on the “+” button in the left of the screen, choose “applications” and under the “Sample” section, you will find your helloWorldPortlet
    create jsf liferay portlet - Deploying the Liferay portlet
  9. Select the helloWorldPortlet and drag and drop it to your page or click on “Add” and refresh the web page
  10. Your portlet is well deployed

    create jsf liferay portlet - Portlet deployedCongratulation ! You created a JSF Liferay Portlet and deployed it on the Liferay Portal.