RE: EXT plugin: build process failure

txapeldot ., modified 1 Year ago. Junior Member Posts: 91 Join Date: 1/15/15 Recent Posts

I'm a newcomer to the world of Customization with Ext, and, in order to create a first Ext plugin, I've decided to override the core functionality of  the PortalImpl.class, following the steps describen here. I've created a 'portal-impl-override' project by using the 'blade' tool; and I've imported that project to my LDS IDE, by using the 'Liferay Module Project' import wizard.
 
Once imported, I've created the package 'com.liferay.portal.util' within '$(PROJECT)/src/extImpl/java folder', and I've copy-pasted the original 'PortalImpl.java' file. But the moment the 'PortalImpl.java' file is pasted within that package, a lot of errors are displayed on that file. The errors appear on the 'import' section, and look like this:

import com.liferay.document.library.kernel.exception.ImageSizeException;
// The import com.liferay.document cannot be resolved
(and more...)

First of all, I don't get to understand why the steps described here don't reflect the situation here described. The documentation finishes saying something like "Awesome! You’ve created an Ext plugin that overrides a core class in Liferay DXP! Follow the instructions in the Deploy the Plugin article to deploy it to your server", but it all is quite far away from the raw reallity.

So far, have I done something wrong? 

In order to get rid of all these errors, I've included a 'dependendies' section within the 'build.gradle' file, following the recomendations of LDS IDE:

dependencies {
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.35.3"
// and more...
}

Once the errors have dissapeared, and in order to get the corresponding .war file, I try to build the project by using the LDS tool 'Gradle Tasks > $(PROJECT) > build > build', but the build process fails, displaying errores like:

> Task :ext:portal-impl-override:compileExtImplJava FAILED
$(WORKSPACE)\ext\portal-impl-override\src\extImpl\java\com\liferay\portal\util\PortalImpl.java:7: error: package com.liferay.document.library.kernel.exception does not exist
import com.liferay.document.library.kernel.exception.ImageSizeException;
(and more...)

The build process informs the package 'com.liferay.document.library.kernel.exception' does not exist, but, as a consecuence of the creation of the dependencies section within the 'build.gradle' file, the library 'com.liferay.portal.kernel-4.35.3.jar' has been downloaded, and there the 'ImageSizeException.class' file can be found within the package 'com.liferay.document.library.kernel.exception'. So I don't get to understand why the build process is failing.

What am I doing wrong? Why the build process fails? Any clarification would really be appreciated.
Thanks.

thumbnail
Olaf Kock, modified 1 Year ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

There was some related discussion on community slack, but nothing here yet.

Please observe: You're linking the 7.1 documentation, and DXP 7.1 is already beyond its premium support phase. At some version, ext support was removed, and there's no way to reliably override Liferay's core implementation - only "OSGi marketplace overrides". If you are on a later version than 7.1, you might be already in an environment where this is the case.

The proper (future-proof) way is to get completely rid of ext: Let us know what problem you're trying to solve: There very likely is an alternative solution that doesn't require ext. And if this is one of the very rare cases where there isn't, this is a pointer for a missing extension point.