Fórum

[Maven] How to access ext from portlet

Daniel Nordhoff-Vergien, modificado 11 Anos atrás.

[Maven] How to access ext from portlet

New Member Postagens: 7 Data de Entrada: 17/03/13 Postagens Recentes
Hi,

I have an maven project with an ext - where I have an service created with ServiceBuilder - and a portlet. Which dependencies do I have to add to the portlet pom to access the *ServiceUtil class from the ext?

Regards

Daniel
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: [Maven] How to access ext from portlet

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
Defining a service within an EXT plugin has been deprecated for awhile and should be avoided.

Packaging a portlet within an EXT plugin is also deprecated and should be avoided.
Daniel Nordhoff-Vergien, modificado 11 Anos atrás.

RE: [Maven] How to access ext from portlet

New Member Postagens: 7 Data de Entrada: 17/03/13 Postagens Recentes
Thanks for the fast answer.

David H Nebinger:
Defining a service within an EXT plugin has been deprecated for awhile and should be avoided.

Which is the way to deploy a service used by several plugins then?
David H Nebinger:

Packaging a portlet within an EXT plugin is also deprecated and should be avoided.

The portlet is not in the EXT. The EXT and the portlet are just having the same parent pom to keep everything together.
thumbnail
David H Nebinger, modificado 11 Anos atrás.

RE: [Maven] How to access ext from portlet

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
Daniel Nordhoff-Vergien:
David H Nebinger:
Defining a service within an EXT plugin has been deprecated for awhile and should be avoided.

Which is the way to deploy a service used by several plugins then?


One portlet should be the 'service provider'. This portlet has the service.xml file, and when built should generate the corresponding service jar.

Other portlets are 'service consumers'. Their liferay-plugin-package.properties file should list the service provider portlet as a required deployment context. In the Liferay IDE, it will automagically copy the service jar from the service provider portlet to the service consumer portlets whenever the service is rebuilt. Honestly I'm not sure if the Liferay maven archetypes are 'smart enough' to do the same thing or whether you need to pull the jar in manually yourself.

Coincidentally, one portlet project can actually host multiple individual portlets (define multiple portlets in portlet.xml and liferay-portlet.xml). This introduces coupling into the portlet plugin project (may be undesirable) but would be a path to resolve multiple portlets accessing the same service jar.
Daniel Nordhoff-Vergien, modificado 11 Anos atrás.

RE: [Maven] How to access ext from portlet

New Member Postagens: 7 Data de Entrada: 17/03/13 Postagens Recentes
Thanks for the answer, the liferay-servicebuilder-archetype creates tow projects, one for the service provider and one to add to the consumer