在依赖中,例如 "bundle" 是什么意思?
<dependency>
<groupId>org.apache.abdera</groupId>
<artifactId>abdera-core</artifactId>
<version>1.1.2</version>
<type>bundle</type>
<scope>compile</scope>
</dependency>
在依赖中,例如 "bundle" 是什么意思?
<dependency>
<groupId>org.apache.abdera</groupId>
<artifactId>abdera-core</artifactId>
<version>1.1.2</version>
<type>bundle</type>
<scope>compile</scope>
</dependency>
这种工件是一个OSGi bundle,通常使用maven-bundle-plugin(属于Apache Felix)来生成。
该插件将模块可用的所有类(模块自己的类、依赖项提供的类、类路径上的其他类)视为一个巨大的集合,然后让您选择一部分这些类来进行打包成jar。它还创建必要的清单信息,使工件成为OSGi捆绑包。
因此,通过使用此依赖项获取的工件是一个jar,但它是通过从更大的类集合中选择子集构建的,而不仅仅是在abdera-core模块中定义的类。
如果您查看abdera项目的pom文件,您将看到maven-bundle-plugin
配置,这会让您了解哪些类已添加到捆绑包中,哪些被保留。