Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of type "bundle" in a maven dependency?

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> 
like image 523
Zeemee Avatar asked Mar 22 '11 10:03

Zeemee


People also ask

What is bundle Maven?

This Maven plugin is based on the BND tool from Peter Kriens. The way BND works is by treating your project as a big collection of classes (e.g., project code, dependencies, and the class path).

What does Maven Bundle plugin do?

The maven-bundle-plugin provides a simple goal to check for missing bundles, and remove them from the local OBR. Configuration: obrRepository path to local OBR, defaults to <local-maven-repository> /repository.

What are the Maven dependencies?

There are two types of dependencies in Maven: direct and transitive. Direct dependencies are the ones that we explicitly include in the project. On the other hand, transitive dependencies are required by direct dependencies. Maven automatically includes required transitive dependencies in our project.


1 Answers

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

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.

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.

like image 54
joelittlejohn Avatar answered Sep 27 '22 17:09

joelittlejohn