Gradle serviceBuilder task definitions

Amos Fong, modified 6 Years ago. Regular Member Posts: 105 Join Date: 2/2/18 Recent Posts
Where can I find the definition (i.e. build.gradle file) for the serviceBuilder task? I'm using Liferay 7.1.0 ga1. I want to know what's happening and I'm also finding an issue where it's writing two of one entity for some reason and I have to go in and physically delete the duplicate or the service module doesn't start up.

It's also writing the services.properties file and I need to include some specific Spring XML configuration to that file. 

​​​​​​​Thanks
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
You shouldn't monkey w/ the task, it does a lot of things in ways that are obfuscated.

I don't understand the generation of two entities, everything comes from the service.xml definition and it shouldn't allow dups.  Can you share your service.xml and describe more about the issue?

You don't (and shouldn't) change service.properties because it is a generated file. Instead, write your stuff into service-ext.properties; that's a file that is not overwritten but will be included in your properties.
Kevin Neibarger, modified 6 Years ago. Regular Member Posts: 105 Join Date: 2/2/18 Recent Posts
Understood, I just want to see what it does. It seems that I've fixed my error, but I'm not sure how. What it was doing was repeating a definition of an entity module in the module-spring.xml after running the service builder (gradle task). I won't show the code because it seems to be a moot point now. I'm guessing I had a configuration wrong or something. 

​​​​​​​Thanks
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
Long story short, it is a wrapper around a custom Liferay java app which parses the service.xml and uses Velocity templates for regenerating the various java source files.

There are mechanisms to use alternative templates, etc., but I have never known of an organization sophisticated and advanced enough to go down this path, especially since it is totally undocumented.
​​​​​​​