This guide assumes that you have the Liferay Eclipse IDE, Liferay SDK and server set up already. The steps below create a basic portlet that is ready to use PrimeFaces.
Step 1: File->New->Liferay Project. Configure as per screen shot. Click Next.
Step 2: Choose JSF 2.x. Choose Primefaces. Click Finish.
Step 3: Open up faces-config.xml (docroot->WEB-INF->faces-config.xml). Replace <phase-listener>com.liferay.faces.bridge.lifecycle.BridgeDebugPhaseListener</phase-listener> with <phase-listener>com.liferay.faces.util.lifecycle.DebugPhaseListener</phase-listener>.Due to some bug in the IDE, the wrong value is populated in the XML. Until the bug is resolved, this is the workaround.
Step 4: By default, all Primefaces portlets use the “aristo” theme. If you need to change the theme, open up web.xml, located in docroot/WEB-INF, and follow the steps given in http://www.primefaces.org/themes.html. Note that changing the theme of one portlet changes the theme for all portlets on that page.
Step 5: Deploy the portlet by dragging the project from the Package Explorer to the Server. If the portlet is deployed successfully, it is now available to be added to the portal. Go to the portal in your web browser and log in. Once logged in, go to the “Add” menu option to the top-left of the screen and select “More…”
Step 6: Under the Sample option, you should find your portlet listed. Add it to your portal. Your portlet should show up after you refresh the page.