Building Liferay Faces From Source
You may have several reasons for downloading and building Liferay Faces from its project sourcee code: - To try out the latest cutting edge changes - To investigate a suspected bug - To learn how Liferay Faces is implemented
Whatever your reasons may be, we’re happy to show you how to access the Liferay Faces source code and build it.
We’ll start with installing the liferay-faces project.
Installing the liferay-faces Project
It’s important to install the version of Liferay Faces that you want. So, it’s a good idea to check the Liferay Faces Version Scheme to confirm the version of Liferay Faces.
You can either install the project by cloning it from GitHub or by downloading it as a
.zip file. We’ll demonstrate both options.
Cloning the project from GitHub
Cloning the project, requires that you set up Git on your machine. Once you’ve set up Git, you can download the liferay-faces project from GitHub and work with a particular branch of the project, following these instructions:
Execute the following command from your terminal:
git clone https://github.com/liferay/liferay-faces.git
Navigate into that directory by executing
Checkout the branch (
master is the default branch) you want to use.
For example, to use the first milestone release of version 4.2.0, execute the following command:
git checkout 4.2.0-m1
Downloading the project as a
To download the liferay-faces project as a
.zip file, follow these instructions:
Visit the Liferay Faces project page, https://github.com/liferay/liferay-faces.
Click on the branch drop-down menu and select the branch or tag for the version of the liferay-faces project that you’d like to use.
Click on the Download Zip button to download the
[branch/tag name].zip file for that branch or tag.
.zip file contents to a location on your machine.
In a terminal window, navigate into the liferay-faces project’s root directory:
Now that you’ve installed the liferay-faces project, you can configure your environment for building the project.
Building Liferay Faces with Maven
Maven is required to build the liferay-faces project. You can download Maven from http://maven.apache.org/download.cgi. We recommend putting your Maven installation’s
bin directory in your system’s
$PATH, so you can run the Maven executable (
mvn) easily from your terminal.
settings.xml into your local
$HOME/.m2/settings.xml file. If you do not already have a
settings.xml file in your Maven configuration, create a
settings.xml file in your
$HOME/.m2 folder and copy the contents of the
settings.xml file into it.
Build the source with Maven by executing the following command:
mvn clean package
Maven builds the following Liferay Faces artifacts:
That’s it; you’ve built Liferay Faces from source!
In the next section, we’ll reflect on what we’ve learned about developing JSF portlets with Liferay Faces.