This tutorial demonstrates how to run Service Builder. If want to use Service
Builder in your application but haven’t yet
service.xml file that defines an object-relational map for you application,
make sure to do so before proceeding with this tutorial.
There are two ways to build services from a
Liferay Dev Studio DXP is demonstrated first.
Using Liferay Dev Studio
From the Package Explorer, right-click on your service module and then select Liferay → build-service.
Service Builder generates plenty of files. You can run Service Builder from the command line too.
Using the Command Line
Open a command line and navigate to your application folder (the folder that
To build your services using Gradle, enter the following command:
blade gw buildService
gw command works in any project that has a Gradle Wrapper available to
it–projects generated using Liferay project templates have a Gradle Wrapper.
If you’re using Maven, build the services by running the following command:
mvn service-builder:build command only works if you’re
com.liferay.portal.tools.service.builder plugin version 1.0.145+.
Maven projects using an earlier version of the Service Builder plugin should
update their POM accordingly. More information is available on
using Maven to run Service Builder.
On successfully building the services, Service Builder prints the message
BUILD SUCCESSFUL. Many generated files appear in your project. They represent a model
layer, service layer, and persistence layer for your entities. Don’t worry about
the number of generated files–they’re explained in the next tutorial. Its time
to review the code Service Builder generates for your entities.