Wiki
How to re-use generated service layer
Introduction
As you probably know XMLPortletFactory uses Liferay service builder to generate its own service layer, and you obtain a full working set of CRUD portlets.
The thing is, that when you are working in a project, probably you have to do other portlets that XMLPortletFactory did not generate, as processes, actualizations, reports, statistics, etc, etc.
This being known, we need to access the files, and we want to re-use the service layer. Well, this actually can be acomplished by modifying the ant build process, in the SDK environment to include in the creation of the ????-service.jar the classes neeeded.
The works
First change your ant file "build-common-plugin.xml" that you can find in your SDK folder, and about line 210 add the lines showed in the red boxes.(6 lines in total)
This step includes "????impl.java" etc. in the "?????-service.jar" that generates.
Now, just copy "?????-service.jar" to your lib folder of your portlet project. This solution works while you have the XMLPortletFactory portlet deployed also (this should be 99% of ocasions), and is because of the ClpSerializer.
Following is an example of a XMLPortletFactory generated portlet (Test-portlet) and a "hand made" portlet that uses its service layer. See that the generated "????-service.jar" file is copied to the new portlet.
Saludos, Jack.