---
title: FAQ
--- name:overview pipeline:ssp

<h1>Frequently Asked Questions</h1>

This page contains all the frequently asked questions about Fuse Bundles

--- name:content pipeline:ssp,markdown

{:toc}

# General FAB questions

General questions about the idea of Fuse Bundles (or FABs).

For questions on the [Fuse](${uri("/index.html")}) project as a whole see the [Fuse FAQ](${uri("/faq.html")})

## What is a Fuse Bundle?

${include("/bundle/_what-is-fab.md")}

## Which build tools generate FABs?

Currently we know these tools generate valid FABs out of the box

* [Apache Maven](http://maven.apache.org/)
* [SBT](https://github.com/harrah/xsbt/wiki) Simple Build Tool from version 0.10 onwards

Most other popular Java centric build tools properly work too (like Ant+Ivy & Gradle etc); they just need to make a [jar with the pom inside](#What_is_a_Fuse_Bundle_).

If you know of another build tool that does this then [please let us know](${uri("/community.html")}) so we can add it to our list of supported build tools.

## Which containers support FABs?

* [Fuse ESB](http://fusesource.com/products/fuse-esb-enterprise/)
* [Apache Karaf](http://karaf.apache.org/) with the [Fuse bundle feature installed](#How_do_I_enable_FAB_support_in_my_OSGi_container_)
* any OSGi container which has the [Fuse bundle feature installed](#How_do_I_enable_FAB_support_in_my_OSGi_container_)

## How does FAB compare to using an OSGi tool to generate the manifest?

There are various tools out there to generate the OSGi manifest information like the [Felix Maven Bundle Plugin](http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html), [BND](http://www.aqute.biz/Bnd/Bnd), [Bndtools](http://bndtools.org/) or the MANIFEST.MF editor in Eclipse.

You have to be a little bit careful with these tools as they only do bytecode analysis and code can refer to class names using indirect means like META-INF/services which won't work with these tools (though they do work with Fuse Bundles inside Fuse ESB).

Though these tools are useful and help the situation for sure; but we've found that using the tools doesn't hide you from the issues; developers have to learn all the OSGi metadata details and how to use them plus they have to learn all about the code generation tools as you frequently hit a wall and have to tweak things; excluding imports or marking imports as optional or whatever.

Fuse bundles on the other hand offer a few advantages over the existing OSGi code generation tools

* application developers don't have to learn both the low level OSGi manifest specification plus learning all about how to use and configure the OSGI code generation tool, they can stick to what they know (their build system like Maven, Ant/Ivy, Gradle, SBT or whatever)
* no need to change the build process to include the OSGi code generation tool; any existing build in one of the popular build tools is fine to use a FAB (e.g. any Maven or SBT build)
* a FAB can work with any jar dependencies whether or not they are already OSGi bundles; no need to explicitly create new OSGi bundles which just wrap one or more other jars - which you then have to invent new groupId/artifactIds and then hack your transitive pom.xml dependencies to use instead of the real jars.
* by default installing a FAB will also install all the transitive dependencies. However with an OSGI bundle an end user has to know what other bundles to install to be able to use the bundle; a Fuse Bundle however knows its transitive dependencies and will install them all as well. So with plain OSGi bundles you typically have to build some other kind of archive like a Features File in Karaf. With Fuse Bundles, you're already done if your Maven / SBT build works :)

In summary Fuse Bundles are very easy to use - they build on the standard build tools and current build configurations; there's no steep OSGi learning curve for developers and when it comes to deploying them they just work; there's no secondary deployment model of other archives of feature files required to install them.

## Can I use FABs inside Features Files or KARs?

The quick answer is yes :).

To use FABs in any kind of archive that contains multiple bundles, just add the **fab:** prefix to the URI of the bundle. 

For example here is how to add a FAB to a features XML file.

{pygmentize:: xml}
<features>
  <feature name="myFeature" version="1.0">
    <bundle>fab:mvn:myGroupId/myArtifact/1.0</bundle>
  </feature>
</features>
{pygmentize}


## Does a FAB have any OSGi limitations?

Quick answer: no not really :)

A FAB automatically creates the actual OSGi metadata if you don't specify any; using the pom.xml to figure out the transitive dependencies of your FAB. 

You still have full access to all the OSGi capabilities so you can always add an explicit *Import-Package* or *Require-Bundle* or whatever to your manifest if you really want to.

However FAB is designed so you typically don't need to deal with the actual low level OSGi metaadata and can instead reuse existing [Java build systems](#Which_build_tools_generate_FABs_) like Maven, SBT etc.

# Using Fuse Bundles

Questions on using Fuse Bundles

## How do I install a FAB?

${include("/bundle/_install-command.md")}

## How do I enable FAB support in my OSGi container?

Just install the **fuse-bundle** feature in your OSGi container.

For example in an Apache Karaf distro run

{pygmentize:: text}
features:addUrl mvn:org.fusesource.fuse/fuse-fuse/${project_version}/xml/features
features:install fuse-bundle
{pygmentize}

