如何将 Elasticsearch Java API 客户端转换为 OSGI 包?

发布于 2025-01-13 18:45:20 字数 1193 浏览 0 评论 0原文

我想将 Elasticsearch Java API 客户端转换为 OSGI 捆绑包,因为它在任何地方都不容易获得。我尝试了以下命令来自己创建一个,但它不起作用。我也尝试过 Maven 捆绑插件,但它导致了同样的错误。我做错了什么?

jar cvfm osgi-elasticsearch-java-8.0.1.jar ./MANIFEST.txt elasticsearch-java-8.0.1.jar

MANIFEST 使用如下:

Manifest-Version: 1.0

Bundle-Category: OSGI ELK

Bundle-Description: Elastic Search Client Bundle

Bundle-ManifestVersion: 2

Bundle-Name: OSGI ELK - HG

Bundle-SymbolicName: osgi-elk.hg

Bundle-Version: 1.7.0

Bundle-ClassPath: .,elasticsearch-java-8.0.1.jar

Export-Package: co.elastic.clients.elasticsearch, co.elastic.clients.elasticsearch.indices, co.elastic.clients.json, co.elastic.clients.json.jackson, co.elastic.clients.transport, co.elastic.clients.transport.rest_client

将手动创建的 Elasticsearch Java API 客户端 OSGI 捆绑包安装到 OSGI 容器后,以下类不可用。

co.elastic.clients.elasticsearch -- Cannot be resolved
co.elastic.clients.elasticsearch.indices -- Cannot be resolved
co.elastic.clients.json -- Cannot be resolved
co.elastic.clients.json.jackson -- Cannot be resolved
co.elastic.clients.transport -- Cannot be resolved
co.elastic.clients.transport.rest_client -- Cannot be resolved

I want to convert Elasticsearch Java API Client into an OSGI bundle as it is not readily available anywhere. I tried the following command to create one on my own but it not work. I also tried maven bundle plugins but it resulted in the same error. What am I doing wrong?

jar cvfm osgi-elasticsearch-java-8.0.1.jar ./MANIFEST.txt elasticsearch-java-8.0.1.jar

The MANIFEST use is as follows:

Manifest-Version: 1.0

Bundle-Category: OSGI ELK

Bundle-Description: Elastic Search Client Bundle

Bundle-ManifestVersion: 2

Bundle-Name: OSGI ELK - HG

Bundle-SymbolicName: osgi-elk.hg

Bundle-Version: 1.7.0

Bundle-ClassPath: .,elasticsearch-java-8.0.1.jar

Export-Package: co.elastic.clients.elasticsearch, co.elastic.clients.elasticsearch.indices, co.elastic.clients.json, co.elastic.clients.json.jackson, co.elastic.clients.transport, co.elastic.clients.transport.rest_client

The following classes are not available after installing the manually created Elasticsearch Java API Client OSGI bundle to a OSGI container.

co.elastic.clients.elasticsearch -- Cannot be resolved
co.elastic.clients.elasticsearch.indices -- Cannot be resolved
co.elastic.clients.json -- Cannot be resolved
co.elastic.clients.json.jackson -- Cannot be resolved
co.elastic.clients.transport -- Cannot be resolved
co.elastic.clients.transport.rest_client -- Cannot be resolved

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文