-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: Master
-
Fix Version/s: None
-
Component/s: Archetypes
-
Labels:None
Description:
My customer is trying to build a JSF / Primefaces portlet for DXP using Maven.
He tried to follow the official documentation but he failed many times. I have tried the same and experienced the same.
The customer would like to receive a set of detailed steps on how to create such a portlet.
Here are the steps we tried so far:
1. Tried to follow the instructions from here:
https://customer.liferay.com/documentation/7.0/develop/tutorials/-/official_documentation/tutorials/maven?_ga=1.100394014.1227419723.1481024927
These points were not clear for the customer:
A) in settings.xml, are these settings correct?:
<liferay.version>7.0.0</liferay.version>
<liferay.maven.plugin.version>7.0.0-m2</liferay.maven.plugin.version>
B) when we generate a JSF or Primefaces plugin from scratch (using the IDE or mvn archetype:generate -Dfilter=liferay as described here https://customer.liferay.com/documentation/7.0/develop/tutorials/-/official_documentation/tutorials/generating-new-projects-using-archetypes) we get a resulting project that won't build because it has dependencies that don't exist anymore in DXP:
<dependency> <groupId>com.liferay.portal</groupId> <artifactId>portal-service</artifactId> <version>${liferay.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.liferay.portal</groupId> <artifactId>util-java</artifactId> <version>${liferay.version}</version> <scope>provided</scope> </dependency>
2. Tried to follow the instructions from here:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/maven
These points were not clear for the customer:
A) The article talks about CE version and not the EE version:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/installing-liferay-maven-artifacts?_ga=1.130279695.1227419723.1481024927
Namely: this file is mentioned: liferay-ce-portal-maven-[version].zip
B) The article: https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/generating-new-projects-using-archetypes points us here http://www.liferayfaces.org/ to generate a JSF portlet, so we did:
mvn archetype:generate \ -DarchetypeGroupId=com.liferay.faces.archetype \ -DarchetypeArtifactId=com.liferay.faces.archetype.jsf.portlet \ -DarchetypeVersion=5.0.1 \ -DgroupId=com.mycompany \ -DartifactId=com.mycompany.my.jsf.portlet
which works OK. Now we import the project into the (new) IDE, right-click the project, do liferay, liferay-maven, liferay:deploy, resulting in "Build Failure"
3. Tried to follow the instructions from here: https://customer.liferay.com/documentation/7.0/develop/tutorials/-/official_documentation/tutorials/generating-new-projects-using-archetypes , we do:
- mvn -e -X archetype:generate -Dfilter=liferay
- choose 38 (liferay-servicebuilder-archetype)
- choose the latest number 36: 7.0.0-m2
- select some random groupId and artifactId, accept defaults for the rest
This generates a project with java 1.6, using portal-service instead of kernel etc. Clearly not a DXP portlet.
Please advise how to build a JSF / Primefaces portlet for DXP using Maven.