Foros de discusión

Unable to retrieve transitive dependencies in liferay 7+ gradle

thumbnail
nitish tyagi, modificado hace 6 años.

Unable to retrieve transitive dependencies in liferay 7+ gradle

New Member Mensajes: 9 Fecha de incorporación: 23/10/12 Mensajes recientes
build.gradle

dependencies {
compileOnly group: 'com.liferay.portal', name: 'com.liferay.portal.kernel', version: '2.0.0', transitive: true
compileOnly group: 'com.liferay.portal', name: 'com.liferay.util.taglib', version: '2.0.0', transitive: true
compileOnly group: 'javax.portlet', name: 'portlet-api', version: '2.0', transitive: true
compileOnly group: 'javax.servlet', name: 'servlet-api', version: '2.5', transitive: true
compileOnly group: 'jstl', name: 'jstl', version: '1.2', transitive: true
compileOnly group: 'org.osgi', name: 'org.osgi.compendium', version: '5.0.0', transitive: true

runtime group: 'com.microsoft.ews-java-api', name: 'ews-java-api', version: '2.0', transitive: true
runtime group: 'org.apache.commons', name: 'commons-lang3', version: '3.4', transitive: true
runtime group: 'commons-codec', name: 'commons-codec', version: '1.9', transitive: true
runtime group: 'commons-logging', name: 'commons-logging', version: '1.2', transitive: true
runtime group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.4.1', transitive: true
runtime group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.1', transitive: true
runtime group: 'joda-time', name: 'joda-time', version: '2.8', transitive: true
runtime group: 'org.apache.avalon.framework', name: 'avalon-framework-api', version: '4.3.1', transitive: true

}

bnd.bnd

Bundle-SymbolicName: sample.servicepoc
Bundle-Version: 1.0.0
Include-Resource:\
@commons-codec-1.9.jar,\
@httpclient-4.4.1.jar,\
@httpcore-4.4.1.jar,\
@ews-java-api-2.0.jar,\
@commons-lang3-3.4.jar,\
@commons-logging-1.2.jar,\
@joda-time-2.8.jar,\
@avalon-framework-api-4.3.1.jar


ERROR:-

org.osgi.framework.BundleException: Could not resolve module: sample.servicepoc [530]
Unresolved requirement: Import-Package: org.apache.log
thumbnail
Andy Wu, modificado hace 6 años.

RE: Unable to retrieve transitive dependencies in liferay 7+ gradle

Regular Member Mensajes: 195 Fecha de incorporación: 5/05/15 Mensajes recientes
hey Nitish , I think you should include org.apache.log related jar manually , cause gradle and bnd.bnd will not include transitive dependencies for you.
Anonymous Anonymous, modificado hace 5 años.

RE: Unable to retrieve transitive dependencies in liferay 7+ gradle

Regular Member Mensajes: 127 Fecha de incorporación: 16/09/19 Mensajes recientes

Hi All ,

 

Facing similar issue with Liferay DXP Tomcat.

Error: 

org.osgi.framework.BundleException: Could not resolve module: xxxx.portlet [1097]
  Unresolved requirement: Import-Package: org.apache.avalon.framework.logger

I am using the dependency :

    compile group: 'commons-logging', name: 'commons-logging', version: '1.0.4' and added to bnd.bnd file as well

 

 

 

 

thumbnail
James Hinkey, modificado hace 5 años.

RE: Unable to retrieve transitive dependencies in liferay 7+ gradle

Junior Member Mensajes: 62 Fecha de incorporación: 15/02/11 Mensajes recientes

Hi Enayath,

Transitive dependencies can be tedious to address. This article explains a process for resolving them: https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/adding-third-party-libraries-to-a-module

thumbnail
Gregory Amerson, modificado hace 5 años.

RE: Unable to retrieve transitive dependencies in liferay 7+ gradle

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes

Thanks Jim for your response, that is exactly correct, likely `compileInclude` instruction would work here.