2015-11-28 8:45 GMT+01:00 David Leangen <[email protected]>:

>
> Hi!
>
> >> There is an easy way to install bundles.
> >> Just use the feature:requirement-add command.
>
> Sounds practical. But then again, I really like the idea of “features”. I
> like to see which “feature” is installed and running. If my bundle is only
> added as a requirement, then I lose that visibility. Also, having to
> restart Karaf each time I want to add a new repository (as is currently the
> case) is not a very nice option for me.
>

Jean-Baptiste is working on that.
I've also pushed support for referencing xml repositories from features
files to a github branch
   https://github.com/gnodet/karaf/tree/KARAF-4130


>
> In any case, feature:requirement-add is currently not working for me, for
> 2 reasons…
>
> 1) The patch I submitted to allow resolution of resources with relative
> URLs only works when
>      there is one single Repository added to the config file. I am
> investigating an updated fix, but:
>
> 2) Something odd happens intermittently when I try to add a requirement.
> Karaf adds “type=karaf.feature”
>      even when I express the type as “osgi.bundle”. Example:
>
> karaf@root()> feature:requirement-add
> ‘osgi.identity=my.bundle;type=osgi.bundle'
> Error executing command: Unable to resolve root: missing requirement
> [root] osgi.identity;
> osgi.identity=“osgi.identity=my.bundle;type=osgi.bundle";
> type=karaf.feature;
> filter:="(&(osgi.identity=osgi.identity=my.bundle;type=osgi.bundle)(type=karaf.feature))”
>
>
Try with feature:requirement-add
‘requirement:osgi.identity;osgi.identity=my.bundle;type=osgi.bundle'


> That filter is very odd, considering that (1) there is no such feature,
> and (2) that is not what I asked for.
>
> I tried stepping my way through the code to understand what is happening,
> but I am finding it very difficult to navigate. There is too much
> complexity IMHO and not enough clarity, at least for an outsider like me.
>
> > You can use the feature service, to install the "top level" feature
> containing the requirements. Then the resolver will install all bundles
> needed from the OBR repo.
>
> I tried this, but unfortunately it appears it won’t work without some more
> updates to Karaf.
>
> Problems:
> * Added features throws an error if it cannot be corresponded to an
> existing “features repository”
> * It seems that currently the ONLY way to add a features repository is by
> having an actual xml file
>    (i.e. it cannot be constructed in runtime without artificially creating
> an xml file just to satisfy the above constraint)
>
> I am investigating this more now, but if you have any hints, that would be
> great.
>
> > To be completely in the line of the feature service it would probably
> also be possible to create a kind of wrapper feature just with the one
> bundle to pull up the rest.
> > So bndtools could be used to define everything besides the wrapper
> feature but that would be no big issue as it is quite trivial.
>
> That would be perfect for my use case. That is in effect what I am
> currently trying to accomplish. I have just run into the above problems,
> though. Since I am not yet very used to the Karaf code base, it takes me a
> while to understand what is going on.
>
> I will continue to investigate this kind of wrapper, but any help would be
> greatly appreciated. You say this is "trivial", but since I don’t know the
> code well, it is taking me a really long time. :-)
>
>
> Cheers,
> =David

Reply via email to