“捆绑"类型的含义是什么?在 Maven 依赖项中? [英] What is the meaning of type "bundle" in a maven dependency?

查看:62
本文介绍了“捆绑"类型的含义是什么?在 Maven 依赖项中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

捆绑"的含义是什么,例如在此依赖项中:

What is the meaning of "bundle" e.g in this dependency:

<dependency>
    <groupId>org.apache.abdera</groupId>
    <artifactId>abdera-core</artifactId>
    <version>1.1.2</version>
    <type>bundle</type>
    <scope>compile</scope>
</dependency>

推荐答案

这种工件是一个 OSGi 包,通常使用 maven-bundle-plugin 这是 阿帕奇菲利克斯.

This kind of artifact is an OSGi bundle, typically produced using the maven-bundle-plugin which is part of Apache Felix.

该插件将模块可用的所有类(模块自己的类、依赖项提供的类、类路径上的其他类)视为一个巨大的集合,然后让您选择这些类的子集捆绑到一个 jar 中.它还创建必要的清单信息以使工件成为 OSGi 包.

The plugin treats all the classes available to your module (the module's own classes, classes provided by dependencies, other classes on the classpath) as one giant set, then lets you select a subset of those classes to bundle into a jar. It also creates the necessary manifest information to make the artifact an OSGi bundle.

因此,您使用此依赖项引入的工件是一个 jar,但它是通过从更大的一组类中选择一个子集构建的 jar,而不仅仅是在 abdera-core 模块中定义的类.

So the artifact you're pulling in by using this dependency is a jar, however it's a jar built by choosing a subset from a much larger set of classes, not just the classes that were defined inside the abdera-core module.

如果你看看 abdera 项目的 pom 您将看到 maven-bundle-plugin 配置,这将使您了解哪些类已添加到包中,哪些类已添加忍住了.

If you have a look at the pom for the abdera project you'll see the maven-bundle-plugin configuration which will give you an idea of which classes have been added to the bundle, and which have been held back.

这篇关于“捆绑"类型的含义是什么?在 Maven 依赖项中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆