0
votes

I am using liferay 6.2 & built a maven portlet and working fine, I want to use its tables to store data for another portlet so that I need its services in this portlet. But we can't access it externally so i find a way something like: required-deployment-contexts=Portlet-Project1 inside liferay-plugin-package.properties, then found its works for Ant only.

I was also finding the xxx-portlet-service.jar but didn't able to, so that i could manually put it in other portlet's lib folder i.e inside tomcat-webapps-xxxportlet-WEB-INF.

Just want to find how to use xxxLocalService.util in other in maven portlet

2

2 Answers

0
votes

The best approach you can implement is a plugin to manage all the interaction with the DB.

First of all you must create a Service with a maven project and include it into your pom.xml in each portlet that you need. Then you can invoke its methods whenever you want because each portlet will store the dependencies.

  1. Create Service Plugin into jar file
  2. Rebuild with mvn clean liferay:build-service
  3. Custom your own methods to manage the iteraction with the DB (LocalServiceUtilImpl and rebuild).
  4. Include this plugin into pom.xml portlets
  5. Rebuild your portlet.

The JAR will be placed in your .m2 folder, then each time that you rebuild your Service Plugin will be updated.

0
votes

If i understood your question correctly, You need to create service builder project using maven and then you can add as dependency in other project wherever you need access to use xxxLocalServicutil class.

You can follow below link to create maven service builder project.

http://www.liferay-guru.com/how-to-use-liferay-servicebuilder-archetype/

As you mentioned in your question.

was also finding the xxx-portlet-service.jar but didn't able to, so that i could manually put it in other portlet's lib folder

To answer this, manually putting .jar file in lib directory will not help when you are working with maven project