« Back

New Maven Archetypes for JSF Portlets

Company Blogs July 6, 2016 By Neil Griffin Staff

UPDATE: September 2, 2016 - Visit www.liferayfaces.org for a convenient web page that helps you determine your archetype:generate command and/or required dependencies.

The Liferay Faces team is working on production support for JSF portlets in Liferay Portal 7.0 and Liferay DXP. As part of this effort, we have developed some archetypes for use with Maven 3.

For a plain JSF portlet, type the following at the command line:
mvn archetype:generate \
  -DgroupId=com.mycompany \
  -DartifactId=com.mycompany.my.jsf.portlet \
  -DarchetypeGroupId=com.liferay.faces.archetype \
  -DarchetypeArtifactId=com.liferay.faces.archetype.jsf.portlet \
  -DarchetypeVersion=5.0.0 \
  -DinteractiveMode=false
For a PrimeFaces portlet, type the following:
mvn archetype:generate \
  -DgroupId=com.mycompany \
  -DartifactId=com.mycompany.my.primefaces.portlet \
  -DarchetypeGroupId=com.liferay.faces.archetype \
  -DarchetypeArtifactId=com.liferay.faces.archetype.primefaces.portlet \
  -DarchetypeVersion=5.0.0 \
  -DinteractiveMode=false
For a Liferay Faces Alloy portlet, type the following:
mvn archetype:generate \
  -DgroupId=com.mycompany \
  -DartifactId=com.mycompany.my.alloy.portlet \
  -DarchetypeGroupId=com.liferay.faces.archetype \
  -DarchetypeArtifactId=com.liferay.faces.archetype.alloy.portlet \
  -DarchetypeVersion=5.0.0 \
  -DinteractiveMode=false
For an ICEfaces portlet, type the following:
mvn archetype:generate \
  -DgroupId=com.mycompany \
  -DartifactId=com.mycompany.my.icefaces.portlet \
  -DarchetypeGroupId=com.liferay.faces.archetype \
  -DarchetypeArtifactId=com.liferay.faces.archetype.icefaces.portlet \
  -DarchetypeVersion=5.0.0 \
  -DinteractiveMode=false
For a RichFaces portlet, type the following:
mvn archetype:generate \
  -DgroupId=com.mycompany \
  -DartifactId=com.mycompany.my.richfaces.portlet \
  -DarchetypeGroupId=com.liferay.faces.archetype \
  -DarchetypeArtifactId=com.liferay.faces.archetype.richfaces.portlet \
  -DarchetypeVersion=5.0.0 \
  -DinteractiveMode=false

Liferay IDE / Liferay Developer Studio

If you are developing your JSF portlets with Eclipse for Java EE Developers, you can install the Liferay IDE pluginsOtherwise, if you are developing with Liferay Developer Studio, the plugins are installed by default.
After your project is created with the mvn archetype:generate command, you can import the project into Eclipse using the following steps:
1. Click File -> Import ...
2. Expand the "Maven" category
3. Click on "Existing Maven Projects" and click Next
4. Enter the full directory path to your newly created project
5. Click Finish
 
In order to deploy the portlet, simply drag the project to the "Liferay 7" or "Liferay DXP" server in the Servers pane.
 
Threaded Replies Author Date
[...] Hi Micael, If you are building the ZIP... Anonymous July 6, 2016 2:15 PM
Hi Neil first want to thank you for the great... Nestor cruz July 10, 2016 9:47 PM
Hi Nestor. Thanks for the encouraging words! ... Neil Griffin July 11, 2016 9:31 AM
[...] Hi Gustavo, We haven't yet released... Anonymous July 22, 2016 4:57 PM
[...] Hi Patrick, Are you an Eclipse user? If... Anonymous July 26, 2016 12:23 PM

[...] Hi Micael, If you are building the ZIP for the 4.2.5-ga6 tag from GitHub then you will need to make the following change in the liferay-faces/reslib/pom.xml descriptor because the download URL for... [...] Read More
Posted on 7/6/16 2:15 PM.
Hi Neil first want to thank you for the great work they do LR7 and JSF.

My question is about how you should make the integration of a project service builder that use Gradle and JSF project that use maven
Posted on 7/10/16 9:47 PM.
Hi Nestor. Thanks for the encouraging words!

You can develop a Gradle-based ServiceBuilder module using the new LR7 OSGi approach. For more info, see this article:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/what-is-s­ervice-builder

And pay close attention to the paragraph at the end that states "Service Builder supports Liferay 7’s modular application development ..." along with the Blade samples.

Once the service is developed, you should be able to include the API jar as a <scope>provided</scope> dependency in your JSF Maven project's pom.xml descriptor.
Posted on 7/11/16 9:31 AM in reply to Nestor cruz.
[...] Hi Gustavo, We haven't yet released official support for JSF in Liferay 7. However, you can create a portlet using our SNAPSHOT jars for now (you could also try our SNAPSHOT maven archetypes).... [...] Read More
Posted on 7/22/16 4:57 PM.
[...] Hi Patrick, Are you an Eclipse user? If so, there is a nice feature in Liferay IDE that gives you JRebel-like fast editing of your source project files that are made instantly available to the... [...] Read More
Posted on 7/26/16 12:23 PM.