You may have several reasons for downloading and building Liferay Faces from its project source code:
- To try out the latest cutting edge changes
- To investigate a suspected bug
- To learn how Liferay Faces is implemented
For this tutorial, you’l learn how to access the Liferay Faces source code and build it yourself.
First, you’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. Both options are demonstrated below.
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 (
masteris 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 on that right side of the page to download the
[branch/tag name].zipfile for that branch or tag.
.zipfile 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. In the next section of this tutorial, you’ll explore building Liferay Faces with Maven.
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. It is recommended to place your Maven installation’s
bin directory in your system’s
$PATH, so you can run the Maven executable (
mvn) easily from your terminal.
settings.xmlinto your local
$HOME/.m2/settings.xmlfile. If you do not already have a
settings.xmlfile in your Maven configuration, create a
settings.xmlfile in your
$HOME/.m2folder and copy the contents of the
settings.xmlfile into it.
Make sure you’re in the liferay-faces directory and, then, 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!