0
votes

We are upgrading from Liferay 4.2 to Liferay 5.2.2. We are using the EXT environment. Previously, in 4.2 there was a directory called /ext/portlets. According for 4.2 doc,

"Portlets placed in this directory will be automatically deployed to the application server when running the ant deploy target from the /ext directory"

Is there an equivalent for 5.2?

At first I though that /ext/modules would do the trick, but it looks like the build file inside of /modules just unwars my portlet war file. This is not sufficient to deploy the portlets, since Liferay needs to augment the web.xml in my portlets' WEB-INF to insert servlet mapping tags.

Just for comparison, 4.2's build file in /ext/portlets directory, would call com.liferay.portal.tools.PortletDeployer and pass my war file as an argument.

I looked around, the PortletDeployer still exists in the 5. 2 code base. It is now located in com.liferay.portal.tools.deploy, but it is not called anywhere from the build files. . I wonder if this means that there is no longer a way to predeploy portlets in 5.2 Liferay. Does Liferay have to be up and running to deploy in 5.2?

1

1 Answers

3
votes

If your portlets are bundled as war, and are not required to run in the same webapp as Liferay, just put your wars in the liferay deploy dir. This directory is defined in your portal-ext.properties file, and overrides the bundled portal.properties file definition of

auto.deploy.deploy.dir=${liferay.home}/deploy

At startup, Liferay scans this directory and installs any found "plugin" (portlet, theme, layout, hook...). You may be interested in the plugins SDK for the portlet and theme creation as it could help you separate portlet developpement and core portal extension. You should also be careful regarding your theme, it may require migration to comply to the 4.3 onward themes.