Overview
This plugin allows the changes made to grails project to be reflected to the portlet running on Liferay without packaging and manual deployment.
This plugin is designed for development use only. The hot deployment feature of Tomcat causes memory leak and you'll get OutOfMemoryError due to the exhaustion of PermGen space after several re-deployments. In that case, please restart Tomcat. Bumping up -XX:MaxPermSize in JVM parameter may defer the error.
Commands
liferay-deploy
This commands performs the following three steps.
- Invoke
grails war , and explode the war file into target/exploded directory.
- Generate Liferay specific configurations in the exploded war, and make modifications to the existing configuration files such as
web.xml .
- Generate Tomcat context xml file, and copy it to
$LIFERAY_HOME/tomcat-x.x.x/conf/Catalina/localhost directory.
liferay-update
This command detects the changes made to
grails-app/portlets ,
grails-app/views , and
grails-app/i18n , copy them to the exploded war file. Liferay's hot deployer automatically picks up the changes and re-deploy the portlet.
Usage
First, you need to start up a Liferay Portal server.
cd $LIFERAY_HOME/tomcat-5.5.27/bin
./startup.sh
This plugin leverages Liferay's HotDeployer for Tomcat. It doesn't work with other application servers.
grails create-project Test1
cd Test1
grails install-plugin liferay-exploded
grails create-portlet My
grails generate-portlet-views My
grails liferay-deploy
Make some changes to your portlet and/or GSPs, and invoke the following command.
Please don't refresh the browser until you see the following message in
catalina.out .
23:29:17,868 INFO [PortletHotDeployListener:219] Registering portlets for Test1
23:29:18,379 INFO [PortletHotDeployListener:303] 2 portlets for Test1 are available for use
You may get an exception if you send HTTP request during the redeployment. In that case, you need to bounce Liferay server.
History
Version 0.8 (06-25-2009)
- Fixed the issue that LIFERAY_HOME is not found on Windows.