Post by Igor Fedorenko
I use maven-bundle-plugin Embed-Dependency feature  to "wrap"
thirdpary dependencies in OSGi bundles and pomDependencies=consider 
Tycho target platform configuration parameter to use these wrapper
bundles from Tycho builds. See m2e embedded maven runtime, for example .
The only real caveat here is that wrapper bundles must be built
separately, before building any tycho project that uses them.
How do target platforms fit into all this?
This stuff is making my head hurt, so I'm probably not very lucid in
explaining what I am trying to do.
I had hoped I could
* Wrap the bundles
* Generate P2 data for them
* Update my Target definition with extra <unit/>s for each new dependency
* Update my plugin's MANIFEST.MF to include each new new dependency
Again, perhaps because I am trying to take a shortcut, I thought I
would just grab the already OSGi'fied bundles at
But that won't have P2 data.
I tried proxying these in Nexus and use the P2 metadata generator but
that doesn't seem to be working (probably because I don't really
understand what its doing, I think it generates the data on insertion
into the repository so probably doesn't work on proxied repositories)
So instead I have managed to get rid of one embedded dependency by:
* Create a pom that specifies the spring repository and a dependency
to an OSGi'fied jar available there.
* Use maven-dependency-plugin to copy the dependencies to lib/
* Manually upload this dependency into our local Nexus, into a
repository that has the Experimental P2 plugins enabled on it. This
will generate the p2 meta data required. (I used a different group to
keep them separate from the spring stuff)
* Delete the use of an embedded jar from .classpath, build.properties,
MANIFEST.MF and bin.includes.
* Add the dependency to the target platform (and reload if necessary)
* Add the dependency to the Required-Bundle of the plugin
* Rebuild plugin in Eclipse (should work)
* Rebuild application with Maven and validate product.zip file runs correctly.
So I will keep going and removing other dependencies.
I'm not sure what is going to happen with these:
1) SNAPSHOT dependencies on other projects we develop
2) SNAPSHOT dependencies within the current maven build
My target platform file uses remote http locations, which obviously
wont have the latest SNAPSHOT versions.