0
votes

I created an Ext project with Maven:

mvn archetype:generate
mvn package
mvn eclipse:eclipse
mvn install

This actually builds 9 different ext "sub projects":

  • <project_name>-ext
  • <project_name>-ext-impl
  • <project_name>-ext-lib-global
  • <project_name>-ext-lib-portal
  • <project_name>-ext-services
  • <project_name>-ext-util-bridges
  • <project_name>-ext-util-java
  • <project_name>-ext-util-taglib
  • <project_name>-ext-web

The root project <project_name> has its own pom.xml. Each of the 9 sub directories have their own pom.xml files and generate a JAR or a WAR file.

I imported all from the root into eclipse. This actually imports the root project and all of the 9 sub projects.

I followed the doc guide to modify portal-ext.properties: https://www.liferay.com/fr/documentation/liferay-portal/6.2/development/-/ai/developing-an-ext-plugin-liferay-portal-6-2-dev-guide-12-en This doc was written with an Ant build so I tried to make it using Maven but I probably missed something.

I set the updated portal-ext.properties version into: ...\<project-name>\<project-name>-ext-impl\src (into the SUB-project)

Now I wanted to deploy this and the problems starts:

Eclipse (Mars) does not allow me to drag and drop the root project (<project_name>), nor the sub-project where I added the file (<project_name>-impl).

The only one that I can drag and drop is <project_name>-ext. But if I do drag and drop this one and restart the liferay server, the ext does not work (it uses my normal portal-ext.properties and not the ext version).

Did I miss anything?

Also, am I supposed to see the portal-ext.properties in any of the jar / war files of any of the 9 sub-projects?

I do not see it in <project_name>-ext, nor in <project_name>-ext-impl

1
First a suggestion: Don't try two new things at once - first learn to build and deploy a webproject with Maven, than try to build and deploy the Liferay Ext plugin. Or the other way around. - Tobias Liefke
And now a question: Where did you try to drop the project? - Tobias Liefke

1 Answers

0
votes

The Ext Plugin in a Maven structure is nothing you can drop into your server in the Liferay IDE - in place deployment is not supported here.

If you are a beginner - you should use the Plugin SDK (Ant).

If you really want to stick to the Maven then you will have to execute:

mvn package

in <project-name> and put the file <project-name>-ext\target\<project-name>-ext-x.x.x.war into LIFERAY_HOME/deployments and restart your Liferay server.

Disadvantage: For redeployment you will have to remove all deployed files and do the whole thing again. Up till now there is an Ant but not a Maven task for redeployment.

Finally you have dropped your portal-ext.properties at the wrong position. Maven is expecting resource files at /src/main/resources, so correct position is .../<project-name>/<project-name>-ext-impl/src/main/resources/portal-ext.properties.

And if the portal-ext.properties is the only reason for the Ext-Plugin: You can simply put that file into LIFERAY_HOME - no need for an Ext plugin here. And some properties are overridable in a Hook as well - which is easier to build and deploy, if you really want to create a package for modification here.

BTW: I'm using Maven for Ext Plugins as well - but in combination with some custom builders for hot deployment from Eclipse.