1

I have a Tycho build which produces the eclipse plugins for an Xtext DSL feature. I now want to make a maven plugin which can process the DSL files. The problem is to get the artifacts the DSL plugin depends on into the maven plugin, as these are not in the Maven repositories. Also, I want the maven plugin to automatically depend on the same artifacts that the DSL plugin depends on.

I think that creating an über-jar with the dependencies would be the best way to go. The problem is to retrieve the dependencies of the DSL plugin and copy these into a directory, so I can build this über-jar.

Has anybody found a solution to this problem? My searches just turn up solutions to the opposite problem; importing a maven dependency into Tycho as (P2) dependencies.

Magne Rasmussen
  • 203
  • 2
  • 5
  • I found a partial answer in [Use dependencies from Eclipse P2 repository in a regular maven build](http://stackoverflow.com/questions/6682028/use-dependencies-from-eclipse-p2-repository-in-a-regular-maven-build). The problem with this is that it pulls down far more artifacts than is actually required. What I want is something similar, but with only the required artifacts (like computed on the feature.xml Dependencies page). – Magne Rasmussen Apr 19 '12 at 08:39
  • You might want to look at this Q/A: http://stackoverflow.com/questions/22311165/handling-non-osgi-dependencies-when-integrating-maven-tycho-and-eclipse/22882100#22882100 – B. Robinson Apr 05 '14 at 15:42

1 Answers1

2

With the packaging type eclipse-repository and the includeAllDependencies switch set to true, you can have Tycho aggregate your plugin and all its transitive dependencies. The build result is a zip of jars (and some p2 metadata) which you shoud be able to transform into an uber-jar using the maven-assembly-plugin.

One additional note: you can't include bundles in eclipse-repository directly (yet), so you'll need to include your bundle via a feature.

oberlies
  • 11,503
  • 4
  • 63
  • 110