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

查看:942
本文介绍了"bundle"类型的含义是什么?在一个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捆绑软件,通常使用

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.

如果您查看

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.

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

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