0

I'm trying to figure out how the pomfirst-thirdparty bundle can be used within the itp04-rcp eclipse-repository.

I figure that I should be able to run:

> cd org.eclipse.tycho-demo\itp02\build02
> mvn org.apache.felix:maven-bundle-plugin:install

And then edit the example.product file in the itp04-rcp\eclipse-repository directory:

<plugins>
  <plugin id="tycho.demo.itp02.bundle" />
</plugins>

When I run mvn package in itp04-rc it complains:

Included element tycho.demo.itp02.bundle 0.0.0 is missing.

This works:

<plugins>
  <plugin id="example-bundle" version="0.0.0" />
</plugins>

<features>
  <!-- <feature id="example-feature" version="0.0.0"/> -->
  <feature id="org.eclipse.rcp" version="0.0.0"/>
  <feature id="org.eclipse.equinox.p2.user.ui" version="0.0.0"/>
</features>

...so why not the itp02.bundle plugin?

Nicholas Albion
  • 3,096
  • 7
  • 33
  • 56
  • build02 is a Tycho build ("manifest first"). Why would you want to build it with the maven-bundle-plugin ("POM first")? Or did you mean to reference the build01 bundles? – oberlies Nov 29 '13 at 14:03
  • Yes, I want to use the pom-first artifact in itp04 (I don't think it's actually used in any of the examples) – Nicholas Albion Nov 29 '13 at 21:12
  • Could you reflect this in the question, i.e. edit the IDs so that they actually reference the POM first bundle from `itp02/build01`? The conflicting information makes it hard to be specific in the answer. – oberlies Dec 02 '13 at 11:55

1 Answers1

0

You cannot use the tycho.demo.itp02.bundle bundle in a Tycho build if it is not in the target platform of the build.

Unlike for example a Maven dependency declaration, the dependency declaration in the product file, i.e. the <plugin id="tycho.demo.itp02.bundle" />, is underspecified:

  • It doens't specify a version.
  • It doesn't specify in which p2 repository to look. (Unlike in Maven, there is no "central" p2 repository with all artifacts.)

To overcome this ambiguity and to pick specific artifact files in a deterministic way, a Tycho project needs a target platform with all candidate artifacts that may be used to match dependency declarations.

How to add content to the target platform depends on what kind of artifacts should be referenced (built by Tycho vs. not built by Tycho, locally built vs. consumed as binary, etc.). For the different options, see the target platform configuration: http://wiki.eclipse.org/Tycho/Target_Platform

oberlies
  • 11,503
  • 4
  • 63
  • 110
  • So do I add a regular maven dependency `tycho.demo.itp02, pomfirst-thirdparty` to [itp04-rcp/eclipse-repository/pom.xml](http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp04-rcp/eclipse-repository/pom.xml) and set `pomDependencies=consider` in [target-platform-configuration of the parent pom](http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp04-rcp/pom.xml)? – Nicholas Albion Nov 29 '13 at 21:24
  • Do the dependencies of `pomfirst-thirdparty` need to be deployed to Nexus as OSGI bundles, or can they be regular jars with standard maven-generated manifests? – Nicholas Albion Nov 29 '13 at 21:28
  • @NicholasAlbion I can add POM snippets to the answer, but these would not match the original question. Please fix the question first so that it uses the right IDs. – oberlies Dec 03 '13 at 08:59