Reputation: 1097
Liferay says to keep the service and portlet under the same directory and maven build refers service.xml from the service directory. As per release management standard, I have to keep the service.jar in the separate repository and portlet in another repository.
I copied the pom.xml and service.xml in the same root directory and mvn compile generates the class files for the source files but Liferay service compile fails with NULLpointerException. How to compile the liferay service builder separately. I am using Liferay v6.2.
mvn clean install liferay:build-service
The pom.xml is available at https://github.com/get2arun/logs/blob/master/pom.xml
The below is the error:
[ERROR] Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.10.15:build-service (default-cli) on project project-business-user-api: null: MojoExecutionException: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.liferay.maven.plugins:liferay-maven-plugin:6.2.10.15:build-service (default-cli) on project project-business-user-api: null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
Upvotes: 0
Views: 876
Reputation: 181
I managed to work around that error by following the steps below. I have just finished testing now. At the end I was able to create a Liferay Plugin Project that contains a Liferay MVC Portlet and a Liferay Service Builder, and upon deployment the Foo_Foo table was successfully created.
Please find the detailed steps below:
I created a new project in the IDE: File - new - Liferay Plugin Project, maven, selected my Maven global profile (settings.xml), Plugin type = Portlet It is important to note that my settings.xml file contains these values:
< liferay.maven.plugin.version>6.2.5< /liferay.maven.plugin.version>
< liferay.version>6.2.5< /liferay.version>
(choosing higher versions resulted in .jar not found errors).
I was using Ubuntu 18.04 + Apache Maven 3.6.0 + blade version 3.7.3.201906241529 I have shared the Project on: https://github.com/peterpetrekanics/Liferay_ServiceBuilder_Maven_6210CE
I hope this helps,
Kind Regards,
Peter
Upvotes: 1