I'm using Liferay 7.1 GA1 Version. I have generated my service/api java classes with service-builder that Liferay IDE provides me.
How can I use these service classes in my other modules? I would like to use "MyServiceBuilder" generated classes in "MyPortlet" like you can see in the following picture.
Thanks.
Structure your project like this:
in the gradle file of the portlet add:
compileOnly project(":modules:test-service:test-service-api")
Right click and select Gradle > Refresh Gradle Project on the test-service folder.
Then use OSGi Declarative Services in your portlet:
@Reference
protected FooLocalService _fooLocalService;