Monday, July 29, 2013

Maven commands needed for a Portlet with service layer



Liferay Service Portlet
---------------------------
When we create a Liferay portlet with service layer is in following structure .

--Root
    --Portlet
    --Service

//This will create the service layers
From Portlet > mvn liferay:build-service

//This will create the jar for the services
From Service > mvn clean package

//This will put the services jar into the folder that will be used for creating war
From Service >mvn install -Dliferay.auto.deploy.dir=(portlet path) -Dfile=.\target\name of the jar file .jar
 
//This will create the war
From Root : mvn clean package

then Copy and  Deploy the war from /target folder

Frequently Needed Maven commands in Liferay :






Steps To Generate Portlet : mvn archetype:generate
(then select appropriate  options by searching liferay )



Steps To Deploy Portlet* : mvn clean install -Dliferay.auto.deploy.dir=(Path of Liferay Deploy Directory)

To Create the War file* : mvn clean package


To install some dependencies jar* : mvn install:install-file -Dfile=D:\jar\util-taglib.jar -DgroupId=com.liferay.portal -DartifactId=util-taglib -Dversion=6.1.20 -Dpackaging=jar
 (DO THIS FOR ALL THE MISSING JARS REQUIRED ,you need to put first manually these jar in some folder(this case D:\jar\ ) than install using above command)


* Need to run all these command from the pom.xml path of the portlet