Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle, OSGi and OBR (or other repository?)

previously I've been using Maven and the maven-bundle-plugin to archive the following:

  • When doing mvn install, local maven repo contains my bundle + all my bundle's deps automatically
  • Local repo becomes OBR repository by mvn bundle:index, also repository.xml is automatically updated with every mvn install.
  • Local repo can now be used for Karaf bundle deployment

Now, I'm looking to migrate some projects to Gradle, which is very nice in many ways. I'm successfully creating bundles using the 'org.dm.bundle' plugin (basic 'osgi' plugin did not allow me to auto-create service components).

By using Gradle's maven plugin I can do gradle install to install my own bundle in local maven repo. I could then use bindex to manually (or through some gradle hacking) index the repo. However, my dependencies are not put into the maven repo, they are only stored in the gradle cache dir. Thus, I can not use the OBR repo to deploy in Karaf yet.

I've been looking around a lot trying to find some good solution to this, but I have not found anything.

I've looked at Karaf feature files, which would allow me to specify mvn URLs directly instead of relying on OBR, but I'd like to avoid messing with feature files manually.

There are references to using Nexus, but only Nexus Pro supports OBR from what I can see?

I'm up for suggestions on alternative solutions as well; the main goal is that I shall be able to deploy my bundles + deps in Karaf. Maven does not have to be used at all really, although I need some way for different Gradle projects to find dependencies from some other projects (which are not part of the same multi-project).

Any ideas or discussions to put me on the right track is appreciated!

like image 597
Johan Ström Avatar asked Feb 24 '15 14:02

Johan Ström


1 Answers

This may be a bit late, but I just stumbled over your question while looking for a way to fetch with gradle from an OBR repository.

As far as I understood you want to push (gradle deploy) to some Maven repository and use it as an OBR repository. This is possible with Eclipse Package Drone, eclipse/packagedrone. You can deploy using Maven/Gradle deploy and let it generate a P2, OBR and OSGi R5 index repository.

like image 53
ctron Avatar answered Nov 16 '22 03:11

ctron