【发布时间】:2017-12-24 10:34:06
【问题描述】:
我编写了一个使用org.apache.http.client.methods.HttpPost 的Liferay 7 模块。
所以我下载了httpclient-osgi JAR 并将其放入deploy/,但是当我尝试启动它时,我得到:
org.osgi.framework.BundleException: Could not resolve module: org.apache.httpcomponents.httpclient [1088]
Unresolved requirement: Import-Package: org.apache.http; version="[4.4.0,4.5.0)"
所以我在 mvnrepository.com 上搜索 org.apache.http。
问题:似乎不存在这样的组件。
除了including the classes inside my Liferay module,我别无选择?
这样做听起来违反了 OSGi 原则:如果我的 100 个 Liferay 模块使用 httpclient,那么在每个模块中都包含 httpclient 听起来不是很模块化。
我是不是想错了?
Liferay中如何以模块化的方式使用第三方组件?
【问题讨论】:
-
@LazerBanana:您的链接指向一个问题,其接受的答案是重定向到 Apache 曾经发布的所有软件列表的链接:www-eu.apache.org/dist 顺便说一下,该树中的大多数 JAR可能不是 OSGi 组件。