使用 Maven Bundlor osgiying 第三方库时如何处理传递依赖

发布于 2025-01-02 04:38:45 字数 208 浏览 3 评论 0原文

我想在我的 osgi 项目中使用 hibernate 4,因此我需要制作 hibernate 4 及其依赖项 osgi 插件,以便它们在 osgi 运行时可用。我正在使用 Maven Bundlor 来执行此操作。因为 hibernate 依赖于其他几个库,其中一些库也具有传递依赖性。有没有办法让maven自动找到所有hibernate 4的依赖项并使其在osgi运行时可用?

谢谢。

I want to use hibernate 4 in my osgi project, therefore I need to make hibernate 4 and its dependencies osgi plugins so that they are available in osgi runtime. I am using maven bundlor to do this. Because hibernate depends on several other libraries, some of which have transitive dependencies as well. Is there a way to let maven automatically finds all hibernate 4's dependencies and make all available in osgi runtime?

Thank you.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

血之狂魔 2025-01-09 04:38:45

检查pax 库以从命令包装 jar线。或者,如果您将工件存储在 Nexus 存储库中,请查看 这个捆绑包制作插件:如果依赖项具有依赖项时捆绑包尚不存在,它会动态生成捆绑包osgi。我使用第二种方法,虽然在配置时有错误,但它可以完成工作。

作为第三个选项,创建将使用 maven-bundle-plugin 来包装 jar 的 pom。当我需要自定义 BND 指令以排除导入或更改导出时,我会使用此方法
我从 pax 生成的父包装器 pom -maven-plugin 和每个包装的jar继承自这个pom

他们都在内部使用BND btw

Check the pax library to wrap the jars from the command line. Or if you store your artifacts in a Nexus repository, take a look at this bundle-maker plugin: it generates the bundles on the fly if they don't exist already when a dependency has a <classifier>osgi</classifier>. I use the second approach and although buggy when configuring, it does the job

As a third option, create poms that will use maven-bundle-plugin to wrap the jars. I use this approach when i need to customize the BND directives to exclude imports or change exports
The parent wrapper pom I generated from the pax-maven-plugin and each wrapped jar inherits from this pom

They all use BND internally btw

森林散布 2025-01-09 04:38:45

为什么不使用 Maven Central 上提供的捆绑包? 此链接提供了所有 hibernate 的列表捆绑。您会注意到 hibernate-core 版本 4.0.1.Final 可通过以下 Maven 依赖项 XML 获得:

<依赖>;
  org.hibernate;
  hibernate-core;
  <版本>4.0.1.最终版

Why not use the bundles available on Maven Central? This link provides a list of all hibernate bundles. You'll notice that hibernate-core version 4.0.1.Final is available with the following maven dependency XML:

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-core</artifactId>
  <version>4.0.1.Final</version>
</dependency>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文