留言板

Unable to retrieve transitive dependencies in liferay 7+ gradle

thumbnail
nitish tyagi,修改在6 年前。

Unable to retrieve transitive dependencies in liferay 7+ gradle

New Member 帖子: 9 加入日期: 12-10-23 最近的帖子
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,修改在6 年前。

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

Regular Member 帖子: 195 加入日期: 15-5-5 最近的帖子
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,修改在5 年前。

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

Regular Member 帖子: 127 加入日期: 19-9-16 最近的帖子

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,修改在5 年前。

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

Junior Member 帖子: 62 加入日期: 11-2-15 最近的帖子

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,修改在5 年前。

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

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子

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