RE: Issues with creating and building ext using maven for Liferay 7.1

thumbnail
Narsingh Pal, modified 6 Years ago. Junior Member Posts: 53 Join Date: 1/18/14 Recent Posts
We want to create an ext using Maven in for “liferay-7.1”.

Build Settings
Maven plugin version used (this is the latest which we could find)<liferay.maven.plugin.version>7.0.0-m2</liferay.maven.plugin.version>

Steps
  1. Create ext plugin using Maven e.g. “my-ext”
  2. Following directories for EXTs are generated
my-ext-ext
my-ext-ext-impl
my-ext-ext-lib-global
my-ext-ext-lib-portal
my-ext-ext-service
my-ext-ext-util-bridges
my-ext-ext-util-java
my-ext-ext-util-taglib
my-ext-ext-web

Issue:
  1. The poms of the above maven modules (sub projects) are still refereeing to old 6.x dependency jars.


Ideally, as per the below article these artifactIds should have been renamed to the new migrated ones for 7.x

https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/upgrading-the-liferay-maven-build


ISSUE : But there seems to be some issue with the Maven archetype for EXT for 7.1 ext




  1. To resolve this, we renamed artIfact Ids, manually in the individual pom.xml files of the modules to the new versions as per the above document
ISSUE:The Build fails at the last step nowReason :The build execution goal : “build-ext” tries to refer portal-service.jar internally and is not able to find/fetch it from Maven Central or Liferay Nexus





​​​​​​​
thumbnail
Narsingh Pal, modified 6 Years ago. Junior Member Posts: 53 Join Date: 1/18/14 Recent Posts
Hello Guys,

Any pointers ?


Thanks and Regards
Narsingh Pal
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
I don't know what you're using, but everything is completely out of whack.

For example, it's trying to download from repository.liferay.com which is the non-cached one that was changed a long while back.

Also it's going after repository.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/portal-service/7.1.10 which simply doesn't exist. Portal-service went away with 6.x, so it is a completely invalid reference.

And 7.0.0-m2 of the maven plugin? A milestone release? I can't believe after all this time a milestone release would still be used.

Finally, I have to add the obligatory "What are you still trying to use EXT for?" Seriously, they've been deprecated for forever and many of the things we used to need EXT for have been replaced with OSGi-supported extension points. I'd be curious if you haven't found the right extension point or if there is one (or more) still missing.
thumbnail
Narsingh Pal, modified 6 Years ago. Junior Member Posts: 53 Join Date: 1/18/14 Recent Posts
Hi David,



I understand that we should be avoiding EXTs in liferay7.x, but lets assume a worst case scenario as mentioned in the below link
https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-0/advanced-customization-with-ext-plugins

What is the process for generating and building an ext plugin using maven for such scenario?


Let me rephrase my question again, basically I am trying to point out two issues

1. Issue in the maven archetype for creating ext in liferay7 -
             It is generating invalid dependency references in the POMS (portal-service, util-bridges, util-java, util-slf4j, util-taglib) which I know haev been removed from liferay7. So, ideally these dependency references should not be present in the POM file generated by the maven archetype. Instead they should have been (com.liferay.portal.kernel, com.liferay.util.bridges, com.liferay.util.java, com.liferay.util.slf4j, com.liferay.util.taglib) respectively

2. Issue in the liferay maven plugin -> build execution goal : “build-ext”

       Even if we correct these references manually in the individual POMS, i.e. make references to the new ones (com.liferay.portal.kernel, com.liferay.util.bridges, com.liferay.util.java, com.liferay.util.slf4j, com.liferay.util.taglib), the build execution goal "build-ext" fails because the liferay maven plugin [7.0.0-m2] which I am trying to use internally references old jars e.g. ((portal-service) which actually doesnot exist because, it is not part of liferay 7.x.


Now, the reason why I am using a milestone release maven plugin is that, I could not find a maven plugin for liferay 7.x apart from (7.0.0-m2, 7.0.0-m1)
https://mvnrepository.com/artifact/com.liferay.maven.plugins/liferay-maven-plugin
This was quiet a surprise for me.

Please let me know if there exists a stable liferay maven plugin apart from the above two (7.0.0-m2, 7.0.0-m1) for liferay7.x which can be used to build an ext ?



I am definitely looking at the possibility of avoiding the use of EXT plugin in our project and will look into the available extension points.



Many thanks to you for sharing your thoughts.


Thanks and Regards
Narsingh Pal
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
The maven plugin that you used to use is just not there/supported anymore.

There's a new set of plugins that work for both maven and gradle, mostly centered around the Liferay Workspace.

You can read all about the maven support here: https://dev.liferay.com/en/develop/tutorials/-/knowledge_base/7-1/maven

You already have the link for the EXT usage, I think now it is just down to the Legacy SDK support, because, well, it really is that deprecated.

I don't know of extension points for either AdvancedPermissionChecker or PDFProcessorImpl, so if you're mucking around with those you probably do need the EXT, but you'll need to stick with using it under a supported path which likely excludes any maven support.
thumbnail
Narsingh Pal, modified 6 Years ago. Junior Member Posts: 53 Join Date: 1/18/14 Recent Posts
Thanks David
thumbnail
Narsingh Pal, modified 6 Years ago. Junior Member Posts: 53 Join Date: 1/18/14 Recent Posts
Ok So I am trying to find an extension point for few of the portal-impl classes that I want to override in liferay 7 e.g. AdvancedPermissionChecker, PDFProcessorImpl
com.liferay.portal.security.permission.AdvancedPermissionChecker
com.liferay.portlet.documentlibrary.util.PDFProcessorImpl
I have an ext for them which was working fine for liferay 6.2


I tried to find it in gogo shell using few combinations and the below one gave me some meaningful output
g! scr:list | grep Permission
[ 589] &nbsp; com.liferay.portal.search.internal.SearchPermissionCheckerImpl &nbsp;enabled
[ 948] &nbsp; com.liferay.staging.security.internal.permission.StagingPermissionCheckerFactory &nbsp;enabled
 
But I think, it still doesnot need my requirement.

Can anyone please help me to figure out liferay7 extension points for the above Classes



Thanks and Regards
Narsingh Pal