Blogs
Try this for now until we have thin WAR archetypes ready
We recently published versions of Liferay Faces artifacts to Maven Central that support deployment of JSF thin WARs. There is A LOT of work we have to do in JIRA before we can produce proper release notes, and we're still working on Maven archetypes that support thin WARs. But this is a long-awaited feature for many JSF portlet developers, and so I'd like to take a moment to show you how to try out thin WAR versions of our demo portlets in Liferay Portal 7.1, 7.2, or 7.3.
Note that plain JSF, PrimeFaces, and Liferay Faces Alloy portlets can be 100% thin, meaning there are zero (JSF related) dependences embedded in the WEB-INF/lib folder of the WAR artifact. CDI based portlets can also be 100% thin. BootsFaces, ButterFaces, and RichFaces portlets are mostly thin meaning that the only JSF related dependencies embedded in WEB-INF/lib would be bootsfaces.jar, butterfaces.jar, and richfaces.jar respectively. At this time, ICEfaces portlets cannot be thin -- they can only be thick, meaning all JSF related dependencies (ICEfaces, Liferay Faces Bridge, Liferay Faces Util, Mojarra) must remain embedded in WEB-INF/lib.
1. Clone the Liferay Faces Bridge Implementation GitHub repository:
git clone https://github.com/liferay/liferay-faces-bridge-impl.git
2. Checkout the 4.2.0 tag, which contains the thin WAR features and demos:
cd liferay-faces-bridge-impl
git checkout 4.2.0
3. Build from the top level folder:mvn clean install
4. Build the demo portlets with the "thin" profile:mvn -P liferay,mojarra,tomcat,redeploy,thin clean package
This should produce .war artifacts in each of the demo /target folders that are a lot smaller in size than what you are accustomed to as a JSF portlet developer. For example, with the "thin" profile, the CDI Applicant demo will be reduced from 10.5MB down to 65KB which is a 99.36% reduction in size!
But before you deploy them, you first have to download the following:
For Liferay Portal 7.3:
com.liferay.faces.alloy-4.1.0.jar
com.liferay.faces.bridge.api-4.2.0.jar
com.liferay.faces.bridge.ext-6.1.0.jar
com.liferay.faces.bridge.impl-4.2.0.jar
com.liferay.faces.portal-4.1.0.jar
com.liferay.faces.util-3.4.0.jar
javax.faces-2.2.20.jar
primefaces-8.0.jar
For Liferay Portal 7.2:
com.liferay.faces.alloy-3.1.0.jar
com.liferay.faces.bridge.api-4.2.0.jar
com.liferay.faces.bridge.ext-6.1.0.jar
com.liferay.faces.bridge.impl-4.2.0.jar
com.liferay.faces.portal-4.1.0.jar
com.liferay.faces.util-3.4.0.jar
javax.faces-2.2.20.jar
primefaces-8.0.jar
For Liferay Portal 7.1:
com.liferay.faces.alloy-3.1.0.jar
com.liferay.faces.bridge.api-4.2.0.jar
com.liferay.faces.bridge.ext-5.1.0.jar
com.liferay.faces.bridge.impl-4.2.0.jar
com.liferay.faces.portal-3.1.0.jar
com.liferay.faces.util-3.4.0.jar
javax.faces-2.2.20.jar
primefaces-8.0.jar
Once you have downloaded the aforementioned set of JAR modules that correspond to your version of Liferay Portal, in order to avoid startup errors, you need to COPY THEM ALL SIMULTANEOUSLY to $LIFERAY_HOME/osgi/modules
The reason why there could be startup errors if you copy them one-at-a-time is because there is an unavoidable circular dependency between the Bridge API and Bridge Implementation JARs (the Bridge API uses a ServiceLoader in order to discover a service in the Bridge Implementation).
Once the JAR modules all startup correctly, you can proceed to copy the demo .WAR artifacts to $LIFERAY_HOME/deploy.
So for now, enjoy trying it out! We'll get the release notes and Maven archetypes done as soon as we can.
Thanks all for your patience,
Neil

