Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Building "shaded" JARs with Tycho?

For m2e, we do this using maven-bundle-plugin <Embed-Dependency>
directive to do this, then let m2e/tycho integration make results
visible to PDE/IDE. This has advantage of full m2e support, including
dynamic handling of pom.xml changes and source code lookup.

The downside, such "wrapper" bundles, as we call them, have to be built
separately during command line build.

See how this is setup for m2e build


On 2014-09-18, 12:14, Andreas Sewe wrote:

I need some advice on building "shaded" JARs with Tycho, i.e., a JAR
that contains all (or most) of its dependencies.

(FYI: The JAR in question is a FindBugs plugin [1] that can also be used
as an Eclipse plugin extending the Eclipse FindBugs plugin. Confusing, eh?)

In Maven-land I would declare all my dependencies as <dependency> and
then use either shade:shade, dependency:copy-dependencies, or
dependency:unpack-dependencies to package a single JAR that is more or
less self-contained; all 3rd-party libraries are included *except* for
the FindBugs API ("provided" scope to the rescue!).

But how do I do this in Tycho-land? Luckily, all my dependencies are
available in p2 repositories and thus in my target platform, but how to
get Tycho to use them (A) as compile-time dependencies and (B) bundle
them as nested JARs in the artifact? And last but not least, (C) how to
do all this in a way that Eclipse PDE sees more or less the same thing
that Tycho does, so that not only the Tycho build succeeds but that your
Eclipse workspace is free of compilation errors?

Properties like jars.extra.classpath [2] give me (A), but need
assistance in the form of dependency:copy for (B), and completely fail
with (C).

Any advice?


[2] <>

Back to the top