Hi,
You need edit etc/org.ops4j.pax.url.mvn.cfg to add remote or local
repos there, from the comment of that file you should be able to know
how to configure it.
Moreover, to install a bundle from the maven repo listed in etc/
org.ops4j.pax.url.mvn.cfg, you need explicitly install that bundle,
only add dependency in pom.xml can't make servicemix install that
bundle automatically.
You can install bundle from servicemix console or edit a feature
descriptor file then install that feature which have the bundle you
want to install.
Freeman
On 2012-1-10, at 上午1:55, scottkm 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.
---------------------------------------------
Freeman Fang
FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com