问题
I am using Liferay 6 with the combination of Struts2. I am using Liferay Bundled Tomcat 7. Its working fine . My question , whenever a change in the resource (portlet.xml or a java file ) and when i click the build.xml , the deployment takes a lot of time . Please tell me how to decrease deployment time
INFO: Server startup in 60602 ms
14:04:00,328 INFO [AutoDeployDir:167] Processing HelloStruts2-portlet-6.0.6.1.war
14:04:00,375 INFO [PortletAutoDeployListener:71] Copying portlets for E:\liferaytomcat\liferay-portal-6.1.0-ce-b4\deploy\HelloStruts2-portlet-6.0.6.1.war
14:04:00,484 INFO [PortletAutoDeployListener:81] Portlets for E:\liferaytomcat\liferay-portal-6.1.0-ce-b4\deploy\HelloStruts2-portlet-6.0.6.1.war copied successfully. Deployment will start in a few seconds.
The server takes a lot of time after this line
回答1:
In the latest versions JRebel included some Liferay-specific integrations so it works now even smoother http://www.liferay.com/community/projects/jrebel/overview
回答2:
There is no other way to propagate changes in portlet.xml, liferay-portlet.xml and other deployment descriptors into the portal than to actually redeploy the application (as you described this takes quite long).
However, there are some possibilities to do that with JSPs - set the developer properties and the changes are visible immediately after reload.
There is also a tool called jRebel that can do the same for java classes and framework configuration. Works seamlessly with spring and spring mvc. Struts is listed in supported frameworks as well so it should work too. After proper set up the scenario is as follows:
change the java file ctrl + s to save and compile file (your IDE must support this) reload the browser (jrebel automaticaly pick ups changes in class files and reloads them immediately).
Unfortunately jRebel is not free.
If you have large number of portlets then splitting them into more web applications might help. This usually reduces time needed for redeploy.
Hope it helps..
回答3:
Remove the filters not used by your application. There are more than 25 filters initialized in portal-properties.
来源:https://stackoverflow.com/questions/8625021/how-to-reduce-deployment-time-with-liferay-tomcat