Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Tycho seems to not pull guice-multibinders properly… possibly because it's a fragment? (Was: Re: Guice and multibinders OSGI versioning and metadata)



On 12-06-06 4:33 PM, Christian Edward Gruber wrote:
On Jun 6, 2012, at 12:36 PM, Igor Fedorenko wrote:

There is no integration between m2e and pde workspace target
platform. This is due to PDE limitations, nothing we can do to
improve the situation, short of rewriting pde, which is not
something high in my priority list at the moment. As a workaround,
you have to setup PDE target platform manually. Either collect
required bundles in local eclipse-installation-like directory
structure or use .target file, if you don't mind guice bits from
orbit.

Ok, Igor… thanks for bearing with me.  IANA OSGI Expert, so how I
believe things should be functioning has been blown apart in this
process, as I try to piece together maven docs, tycho docs, OSGI
specs, and mailing-list/Stack-Overflow output.  Your patience is
appreciated.

I think I'm starting to see how things work here, and please correct
any misunderstandings herein.  I was having things in my environment
pollute the situation in a way that made it hard to reason about.
Let me see if I really understand what you're saying (and what I've
been reading).

Tycho pulls from p2 repositories and can consider m2 repositories if
the items have OSGI metadata.  That's all fine and good, and it'll
pull in the bundles to do compilation and other tasks through maven
or the p2 resolver.  So far so good.  yes?

This is correct.


As I understand it, now, Eclipse's PDE has to know about everything
through p2 resolution.  If i happen to have things kicking around
locally, it might resolve those first (open projects, or things
pushed into my workspace that satisfy the bundle and fragment
dependencies), but the PDE is entirely uninterested in what tycho has
produced.  This happens to include open PDE projects, which
maven-bundle-plugin projects happen also to be, so PDE can satisfy
the dependency properly from within the eclipse environment… the
maven element is entirely unrelated.

So, if I want to work on things between the command-line and eclipse
I have to maintain my dependencies in the pom.xml file, and ALSO have
eclipse see the bundles through some other means, which may be a
local p2 repository, or something like Orbit.   Or keep open PDE
projects for all dependencies that aren't in a p2 repo.  Correct?


PDE resolves dependencies from open workspace "plugin" projects and
workspace target platform. Workspace target platform can be configured
through .target file or as local eclipse installation.

If all your dependencies are available from p2 repositories, then it is
possible to configured .target file that will work both for PDE and Tycho.

There is no nice/clean solution that will allow PDE resolve dependencies
from maven2 repositories, but there few possible workarounds

- create p2 repository with dependencies available from maven2
repositories and reference it form .target file used both by tycho and pde.
- create local eclipse installation with all dependencies and use it as
pde workspace target platform
- import maven2 dependencies as workspace projects. this works for
maven-bundle-plugin projects and requires m2e-tycho to "bridge" m-b-p
and pde.


So, three things then:

1. Your project did not work in eclipse.  It worked from the
command-line, but even with Orbit, in a clean workspace, it didn't
pull in the fragment for multibindigs, so I still get no resolution
in the PDE.


PDE workspace target platform needs to include all project dependencies.
Eclipse Help website appears to be down atm, so I can't give you links
to relevant documentation, but search for "eclipse pde target platform"
when it comes back.

2. Would it help if we maintained a p2 complaint repository of guice
artifacts?


You will also need to setup .target file to use the repository, but yes,
this will work.

3. Is Sonatype planning on manifesting OSGI-compliant bundles that
are held within the central m2 repo?  I had read something about
Nexus and OSGI p2 repos.

I am not sure I understand the question. If you are asking about
exposing all OSGi bundles deployed to Central as p2 repository, I do not
believe there are immediate plans to do this.


I did not expect Tycho to honour Eclipse-ExtensibleAPI, so I am
surprised you needed it to make command line build work.

I have gone back and forth so many times and now I'm confused again
on this point.  I think I had too many variables in my testing and so
it seemed this was so.  At this point, it seems to not matter - it
was co-incident with Eclipse 3.8 caching a copy of guice from orbit
into an eclipse38/test/plugins directory and satisfying the p2
dependency from there.

Is there a way that Tycho could have a goal that pulled together a p2
repository locally out of all your m2-satisfied dependencies?


I don't believe this is currently possible and I don't think this is a
good idea either. Lack of PDE support is the problem here, so I believe
PDE is the right place to solve it.

--
Regards,
Igor


Back to the top