Scott,

It looks like a lot of your confusion is caused by our own terminology
here, especially the overloaded word 'repository'.

ServiceMix is capable of installing bundles through Maven URLs - the Maven
artifacts for those are being downloaded from Maven repositories (like the
SpringSource one or central repo).  So if you do an osgi:install -s
mvn:org.apache.camel/camel-rmi/2.9.0 it will download that artifact from a
maven repository (if necessary) and afterwards install and start a bundle.

If you have to install multiple bundles, you can create a features xml file
(described in
http://karaf.apache.org/manual/latest-2.2.x/users-guide/provisioning.html)
to list all the bundles that need to be installed.  Once the file has been
created, you can either drop it into the deploy directory or use
features:addurl <url to your features.xml file> and features:install to
install your newly defined feature with all its bundles.  (in the console,
if you do a features:listurl, we also call these features files
'repositories' so that probably adds quite a bit to the confusion)

And finally (our third meaning for the same word 'repository'), in OSGi
land, there's also something called OBR repositories, which allows the
container to figure out which bundles to install.  The easiest way to get
your hands on an OBR repository XML would be to use the maven-bundle-plugin
to generate the file and then refer to that file from the obr: commands.
 Personally however, I would recommend you to use the features xml approach
because it allows you very precise control over the bundles that are being
installed and it's easier to get started with than the OBR approach.

One final remark: if you're new to ServiceMix, I would recommend you to use
the default assembly instead of the JBI one - the JBI one is mainly meant
for people who have existing JBI artifacts to deploy, e.g. if you're
migrating from an earlier version of ServiceMix.  For new users and new
projects, we definitely recommend using Camel/CXF on ServiceMix directly
instead.


Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/


On Mon, Jan 9, 2012 at 6:55 PM, scottkm <[email protected]> wrote:

> Hi,
>
> I am new to ServiceMix and am having some difficulty in configuring
> repositories to handle dependencies of Jars and bundles.  The quick version
> of my question is, what is the best way to setup a ServiceMix site to be
> able to use bundle repositories, Maven and your own generated Jars and
> bundles? I would like to be able to deploy my own bundle and have
> dependencies managed by the container.  As far as I can tell all of the
> support is there but I'm not having any luck finding an example or the
> relevant documentation.
>
> I'm now using ServiceMix 4.4.0 and will outline the details of what I have
> tried here.  I download the JBI version of the new ServiceMix and noticed
> that there are several feature repositories configured.  These seem to
> concentrate on the core of SericeMix and may not have a wide variety of
> other bundles available.  I'm not sure how to get a list of the features
> available in these repositories, but there are several other repositories
> such as SpringSource (http://www.springsource.com/repository), Fusesource
> (http://repo.fusesource.com/) or OSGI OBR repositories
> (http://www.osgi.org/Repository/HomePage) as well.  How would I go about
> using these repositories? There are also several posts on this mailing list
> that reference other bundles being added to the ServiceMix repositories
> somewhere but I'm not sure which repositories or how to access them.
>
> I tried to modify an example (jbi/camel) to make use of a library I found
> on
> the SpringSource site called NekoHTML.  I added the SpringSource repository
> and dependency information to the Maven POM. The Maven portion resolves
> just
> fine and will build the bundle.  It looks good except that the required
> Jars
> are now part of the bundle and I would prefer to have the separate bundles
> loaded into the ServiceMix container.  I changed the "scope" tag to
> "provided" so that now the Jars are not part of the bundle.  This version
> will build but not run because the required Jars are not loaded
> automatically.  See attached for the modified example.
> http://servicemix.396122.n5.nabble.com/file/n5131903/camel-mod.zip
> camel-mod.zip
>
> How do I get the server (ServiceMix/Karaf) to automatically resolve the
> bundles and install them?  The OSGI compatible bundles are already part of
> a
> Maven repository (SpringSource) so all of the manifests and dependency
> information should be there.  I've tried adding the SpringSource repository
> as a feature repository (features:addUrl) with no luck.  I then tried to
> install the obr features (features:install obr) and add the SpringSource as
> an OBR repository (obr:addUrl), again with no luck.
>
> I then tried to extend the simple example to use a library of my own making
> but am having the same problem.  What is considered best practice for
> deploying your own jars? A straight forward approach was noted on
> StackOverflow
> (
> http://stackoverflow.com/questions/3926863/how-to-deploy-osgi-apps-and-dependencies
> )
> that consisted of using the maven-bundle-plugin to generate an OBR index
> (~/.m2/repository/repository.xml) and add that as an OBR repository.  The
> ServiceMix JBI plugin, however, doesn't seem to generate or update the OBR
> index and it's not obvious (at least to me) how to get ServiceMix to use
> the
> local Maven repository to resolve dependencies.
>
> A similar post on this mailing list asking about deploying your own
> libraries with the JBI plugin can be found at
>
> http://servicemix.396122.n5.nabble.com/How-to-integrate-servicemix-shared-libraries-using-jbi-maven-plugin-td5125417.html
> .
>
> The features available with ServiceMix are impressive and I look forward to
> building a prototype with it.  Any hints towards best practice or
> documentation for any of the above would be greatly appreciated.
>
> Thanks,
> Scott
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Feature-repositories-OBR-and-my-own-Jars-tp5131903p5131903.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

Reply via email to