Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Advice: OSGi'fy jars into target platform or Classpath and included in bundle?

On Tue, May 29, 2012 at 8:53 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
> I use maven-bundle-plugin Embed-Dependency feature [1] to "wrap"
> thirdpary dependencies in OSGi bundles and pomDependencies=consider [2]
> Tycho target platform configuration parameter to use these wrapper
> bundles from Tycho builds. See m2e embedded maven runtime, for example [3].
>
> The only real caveat here is that wrapper bundles must be built
> separately, before building any tycho project that uses them.
>
>
> [1] http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
> [2]
> https://docs.sonatype.org/display/TYCHO/Dependency+on+pom-first+artifacts
> [3]
> http://git.eclipse.org/c/m2e/m2e-core.git/tree/?id=milestones/1.1/1.1.0.20120505-1126

Thanks [3] was a big help.
Pity something is wrong on my end that made cloning the repo
impossible... Stupid firewalls.

I'll also add some advice for google.

If you find maven-bundle-plugin doesn't embed your jars, make sure you
have <instructions> after <configuration>.
I wasted a good 30 minutes trying out different black magic
instructions trying to work out why the classpath details from -X
looked fine in log output but nothing was in the jar file,
only to finally notice I had missed "instructions".  Oops.

Then I had to back out all those hacks.
At least I got to understand what Embed-Dependency and ;inline=true
meant and why I should be using _exportcontents insteads (so that it
doesn't include the jar AND a copy of the class extracted from the jar
for everything listed in Export-Package).

Its late in the day so I will do some more wrapping tomorrow and see
what other problems I need resolve.


Back to the top