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

http://git.eclipse.org/c/m2e/m2e-core.git/tree/m2e-maven-runtime?id=releases/1.5/1.5.0.20140606-0033

--
Regards,
Igor

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

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?

Andreas

[1]
<https://code.google.com/p/findbugs/wiki/DetectorPluginTutorial#Building>
[2] <http://www.eclipse.org/tycho/sitedocs/BuildProperties.html>



Back to the top