Archive for octobre 2011

From zero to Liferay portlet in less that 5 minutes (depending on your network connection)

Following this recipe, i can write a new portlets (for demoing purpose) in a very short time !

1) Create a the repertory structure and download a fresh bundle distribution:

mkdir $HOME/liferay
mkdir $HOME/liferay/portlets
mkdir $HOME/liferay/bundles
cd $HOME/liferay/bundles

(you may know want to run liferay : just run the script ‘$HOME/liferay/liferay-portal-6.0/jetty-6.1.24/bin/

3) Create a new portlet project using the liferay archetype

cd $HOME/liferay/portlets
mvn archetype:generate \
-DarchetypeGroupId=com.liferay.maven.archetypes \
-DarchetypeArtifactId=liferay-portlet-archetype \
-DarchetypeVersion=6.0.6 \
-DgroupId=net.jr.testapp \

You just have to modify the property at the end of the generated pom.xml :


The portlet can be recompiled/deployed easily by running the following command :

mvn clean package liferay:deploy

4) The only things that are needed to customize the portlet is to modify the main.js and view.jsp files…

5) More fancy things may be done by turning the project into an Eclipe project, and then import it using Eclipe :

mvn eclipse:eclipse

It doesn’t take more than 5 minutes, counting the time it needs to download the Liferay bundle !

Catégories :Uncategorized