You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "wulfgar.pro" <ja...@dsto.defence.gov.au> on 2011/12/05 03:10:24 UTC

Maven+Nexus and OSGi bundles via Fuse ESB

Hi,

I'm using Fuse ESB which is built on-top of Apache Karaf. Under Karaf I'm
using Apache Felix as my OSGi run-time.

One of my Java projects is a data-layer for MongoDB. This project relies on
various 3-rd party dependencies:

 - morphia
 - mongodb-java-driver
 - etc.

I've had trouble in the past re the Moprhia Maven repo - configuring the
repository in Nexus, the required depdendencies can't be resolved with
Maven. To get around this, I have had to manually install the artifact into
Nexus' 3rd-party repository.

Morphia wasn't orginally an OSGi bundle - I had to convert it using the
maven-bundle-plugin before uploading it to Nexus.

My local Nexus repo has the aformentioned dependencies available (including
Morphia as noted) - I can find them doing a search via the Nexus web-app.
Downloading these manually from Nexus, I can tell that they are OSGi bundles
as per their MANIFEST files (they all list Export-packages and
Import-packages).

>From the Karaf console, installing my project via the mvn: protocol, the
dependencies cannot be resolved via Nexus:

i.e.

Error executing command: Unresolved constraint in bundle xx.xx.xx.xx [223]:
Unable to resolve 223.0: missing requirement [223.0] package;
(package=com.google.code.morphia)

I thought this might have something to do directly with Nexus - therefore, I
removed Nexus from the picture - trying only with the default Maven
repositories configured for Fuse ESB:

i.e. 

org.ops4j.pax.url.mvn.repositories= \
    http://repo1.maven.org/maven2, \
    http://repo.fusesource.com/nexus/content/repositories/releases, \
   
http://repo.fusesource.com/nexus/content/repositories/snapshots@snapshots@noreleases,
\
   
http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases,
\
    http://svn.apache.org/repos/asf/servicemix/m2-repo, \
    http://repository.springsource.com/maven/bundles/release, \
    http://repository.springsource.com/maven/bundles/external \

After this, Karaf is unable to download the Morphia dependency as it has
it's own Maven repository not listed above. Therefore, I configured the
Morphia repo for Fuse ESB:

i.e. 

org.ops4j.pax.url.mvn.repositories= \
    http://repo1.maven.org/maven2, \
    http://repo.fusesource.com/nexus/content/repositories/releases, \
   
http://repo.fusesource.com/nexus/content/repositories/snapshots@snapshots@noreleases,
\
   
http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases,
\
    http://svn.apache.org/repos/asf/servicemix/m2-repo, \
    http://repository.springsource.com/maven/bundles/release, \
    http://repository.springsource.com/maven/bundles/external, \
    *http://morphia.googlecode.com/svn/mavenrepo*

This still failed.

As a test, I placed the Morphia bundle (created with the
maven-bundle-plugin) into the Fuse deploy directory - this resolved the
missing Morphia artifact, but additional flow on continues:

i.e.

Error executing command: Unresolved constraint in bundle xx.xx.xx.xx [238]:
Unable to resolve 238.0: missing requirement [238.0] package;
(package=com.google.code.morphia) [caused by: Unable to resolve 237.0:
missing requirement [237.0] package; (package=com.mongodb)]

Futhermore, I used the Maven install plugin's install:install-file goal;
this bahaves the same as copying the artifacts across to the deploy
directory - I am still required to source and install all OSGi bundles from
my local repo - that is, they arn't automatically fetched and installed as
dependencies for me.

How can I fetch OSGi bundles and all dependencies from Nexus or any of the
public Maven repositories into Apache Karaf via Fuse ESB?

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Nexus-and-OSGi-bundles-via-Fuse-ESB-tp5047655p5047655.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven+Nexus and OSGi bundles via Fuse ESB

Posted by "wulfgar.pro" <ja...@dsto.defence.gov.au>.
I got around this today by installing a trial version of Nexus Professional.
The professional edition has support for OBR. This way I can create my own
hosted OBR, where I can deploy my 3rd party libs as bundles for discovery
and resolution via Karaf's `obr` feature.

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-Nexus-and-OSGi-bundles-via-Fuse-ESB-tp5047655p5048462.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org