Bundle dependencies [message #132819] |
Thu, 11 June 2009 11:06  |
Eclipse User |
|
|
|
Hi,
How can I query bundle dependencies?
Is there any bundle that allows me to inquiry bundle dependencies? That
would be great!
Thanks in advance.
Kind regards.
Maurizio
|
|
|
Re: Bundle dependencies [message #132904 is a reply to message #132819] |
Fri, 12 June 2009 08:33   |
Eclipse User |
|
|
|
Maurizio wrote:
> Hi,
> How can I query bundle dependencies?
>
> Is there any bundle that allows me to inquiry bundle dependencies? That
> would be great!
>
Depends on where, and in what form those bundles are. Do you mean the
installed bundles, a bundle in an update site or p2 repository, a bundle
in source form (perhaps in source code repo), or a binary bundle
floating around on disk or internet somewhere...
For installed bundles, you can use p2 (provisional) API to get
information from the profile (what is currently installed) and then get
the required and provided capabilities (i.e. dependencies) for the
installable unit that represents the bundle. You can do the same for
bundles in a p2 repository (i.e. for things not installed).
If you are interested in a bundle in source form, on just referenced via
a URL then you could use Buckminster, as Buckminster has a variety of
adapters for different types of meta data (e.g. eclipse artifacts in
source and binary form, and maven artifacts). Using Buckminster's API
you can find a ComponentSpecification (CSPEC) that represents the
bundle, and its API can give you a list of dependencies.
Hope that gives you some starting points...
Regards
- henrik
|
|
|
|
Re: Bundle dependencies [message #133062 is a reply to message #133037] |
Mon, 15 June 2009 07:19  |
Eclipse User |
|
|
|
Maurizio wrote:
> Dear Henrik,
> Thanks very much for your reply.
> I'm not requiring bundles in source format. Only installed bundles, at
> this moment.
> I understand that there are API to inquiry their dependencies, but I was
> wondering if I could access their manifest, where the "Require-Bundle"
> should be explicit mentioned and so I can download or install any other
> bundle that is required.
>
> To make an example, I started downloading a tutorial for using
> Server-Side Equinox from javaworld website:
> com.javaworld.sample.osgi.web.declarative. The manifest indicated
> explicitly "Require-Bundle: org.eclipse.equinox.http.registry", and so I
> downloaded such bundle before starting my example. The point is that
> such bundle seems to require "org.eclipse.equinox.registry", and I
> didn't know that until I started my declarative bundle.
> In this case, having the possibility to access the manifest for the
> bundle that I downloaded (org.eclipse.equinox.http.registry) whould have
> done the job that I was looking for.
>
> Does all this make sense?
> Am I following an incorrect approach?
>
I think you should take a closer look at p2. It sounds like you really
want to install everything that is required - and this is exactly what
p2 does for you. It takes everything you have installed into account, as
well as everything in known repositories, solves dependencies and
requirements and executes the installation.
Looking at "required bundle" is not enough, you must also handle package
imports, and in some cases you may also need to search for fragments in
order to find a working configuration. Filters and constraints in
installed features and plugins must also be taken into account. If you
try this on your own, you will find that it quickly snowballs on you and
eventually you will end up reimplementing the capabilities in p2.
If all you want to do is view the list of required bundles for things in
your workspace/IDE, then the Buckminster component view is one way of
displaying them. The Buckminster view works in earlier Eclipse versions
as well. (I am sure there are other ways of finding the dependencies,
but the Buckminster component view is what I usually use for a quick look).
Regards
- henrik
|
|
|
Powered by
FUDForum. Page generated in 0.03448 seconds