I am trying to add an external library to Liferay - the Orika lib.
I have added the Gradle dependency in build.gradle like this:
compileInclude group: 'ma.glasnost.orika', name: 'orika-core', version: '1.5.4'
I am using compile Include in order the module to also have the dependency attached to it.
The lib is working great locally - I have tested it with a main method inside the class, but when I deploy to Portal I receive the following error:
org.osgi.framework.BundleException: Could not resolve module: <YourModuleName> [2755]_ Unresolved requirement: Import-Package: com.google.common.base_ [Sanitized]
This seems to be caused by missing libs at the runtime, but what is not so clear is why are these dependencies added at build time if when I run it within public static main
it works as expected ?
Also, I have checked the libs Gradle downloaded in my Eclipse to see if there is any package with com.google.commom.base
and I found none.
So, because some other step is done when building, I checked the the MANIFEST.MF in the generated jar (eg. eclipse-workspace<your_project_name>\modules<your_module_name>\build\libs) and then removing the entry com.google.commom.base
from file. The error dissapeared, but another one occurred:
org.osgi.framework.BundleException: Could not resolve module: <your_module_name> [2755]_ Unresolved requirement: Import-Package: com.sun.jdi_ [Sanitized]
So, the question is - Why are those dependencies added and how can I drop or satisfy them ? - given the fact that I do not have them in Eclipse, then I would go for dropping them.