Skip to main content

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


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] <>

Codetrails GmbH
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940

Back to the top