Karaf Cave vs org.apache.felix.bundlerepository

笑着哭i 提交于 2019-12-07 18:46:32

问题


Good day.

I am trying to get the benefits of OBR in my application. I took Karaf Cave (4.0.0) as OBR implementation and org.apache.felix.bundlerepository (2.0.4) as OBR client. I successfully configured the repository itself but I can't properly use it. The problem is: when I install the bundle via OBR and all its dependencies are already installed in OSGI runtime, it is installed successfully. But if some of the requirements are missing, I got an "Unsatisfied requirements" error, which is odd, since I know for sure that all the resources which resolves these requirements are present in the OBR descriptor and all links to them are valid.

Why aren't they resolved automatically? How to configure OBR client to work with Karaf Cave?

I also tried OBR implementation from Sonatype Nexus (OBR plugin) and found out that the OBR descriptor generated by Cave, and the one generated by Nexus, are differ. Moreover:

  • the one generated by Cave is OSGI compendium spec compliant
  • the one generated by Nexus is not, but works like a charm with org.apache.felix.bundlerepository - the problem is not reproduced.

I am completely confused.

The step sequence to reproduce the problem (reproduced on Apache Karaf 4.0.0):

1) Installing Karaf Cave:

feature:repo-add cave
feature:install cave-server cave-http

2) Creating a cave repository:

cave:create-repository test
cave:proxy-repository test file:///path/to/some/local/maven/repo
  • On this step I am able to successfully retrieve an OBR descriptor from http://localhost:8181/cave/http/test-repository.xml

3) Install the OBR client and register 'test' cave repository from Karaf:

feature:install obr
obr:url-add http://localhost:8181/cave/http/test-repository.xml

4) Try to deploy some OBR resources with obr:deploy

来源:https://stackoverflow.com/questions/32180312/karaf-cave-vs-org-apache-felix-bundlerepository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!