Tycho: Dependency resolver uses versions of Eclipse platform plugins which cannot be fetched from the Eclipse p2 repository through a P2 Nexus proxy

StackOverflow https://stackoverflow.com/questions/19294153

Question

Situation

  • I have an Eclipse RCP application that gets built with maven using Tycho.
  • The application gets built from the command line using a simple mvn install.
  • During the build, the p2 dependencies are retrieved from a Nexus proxy repository, mirroring Eclipse's kepler repository.

Problem

Until a while ago, this build worked fine. All dependencies were resolved and fetched correctly.

Now the Tycho OSGi dependency resolver starts adding dependencies to Platform plug-ins for version X, while the Kepler version for that plug-in is version Y.

For example:

  • Kepler version: org.eclipse.emf.ecore.xmi_2.9.0.v20130528-0742
  • OSGi dependency: org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309

The resulting Maven output is:

[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: com.mycompany.products.myproduct:myproduct.gui.build:1.8.17-SNAPSHOT @ /home/myusername/programming/myproduct/gui/product-gui-1.8.x/gui/myproduct.gui.build/pom.xml
[INFO] Adding repository http://nexus.buildnet.mycompany.com/nexus/content/repositories/myproduct-releases/.meta/p2
[INFO] Adding repository http://nexus.buildnet.mycompany.com/nexus/content/repositories/myproduct-snapshots/.meta/p2
[INFO] Adding repository http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler
[INFO] Resolving dependencies of MavenProject: com.mycompany.products.myproduct:myproduct.gui.build:1.8.17-SNAPSHOT @ /home/myusername/programming/myproduct/gui/product-gui-1.8.x/gui/myproduct.gui.build/pom.xml
[INFO] Downloading org.eclipse.core.runtime
[INFO] Fetching org.eclipse.core.runtime_3.9.0.v20130326-1255.jar.pack.gz from http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/ (0B of 31.5kB at 0B/s)
[INFO] Fetching org.eclipse.core.runtime_3.9.0.v20130326-1255.jar.pack.gz from http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/ (4kB of 31.5kB at 0B/s)
[INFO] 1 operation remaining.
[INFO] Downloading org.eclipse.emf.ecore.xmi
[INFO] Downloading org.eclipse.ui.workbench
[INFO] Downloading org.eclipse.jface
...
<many are downloaded correctly>
...
[INFO] Downloading org.eclipse.rcp_root
[INFO] Downloading org.eclipse.swt.gtk.linux.x86
[ERROR] Internal error: java.lang.RuntimeException: "Messages while reading artifacts from child repositories": ["Problems while reading artifacts from http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler": ["Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar.", "Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.ui.workbench_3.105.1.v20130821-1411.jar.", "Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.jface_3.9.1.v20130725-1141.jar.", "Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.core.resources_3.8.101.v20130717-0806.jar.",............]] -> [Help 1]

Question

How does Tycho pick dependency versions? I read here that I just need to add the Kepler repository to my project to match Tycho against the Kepler target platform.

How can Tycho pick versions that do not seem to be stored in the Kepler repository. Where does the Tycho dependency resolver find these non-Kepler versions?

Was it helpful?

Solution

As pointed out by greg-449, Kepler Service Release 1 was recently added to the Kepler p2 repository http://download.eclipse.org/releases/kepler/. So the new versions of org.eclipse.emf.ecore.xmi etc. are in fact part of the Kepler repository.

The fact that Tycho cannot download the new version of the artifact seems to be a problem in your Nexus p2 repository proxy setup. The artifact org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar is available in the original repository (both logically according to the p2 index and physical). From my experience, the Nexus p2 repository proxy doesn't work reliably with composite p2 repositories (like Kepler).

There is the option to only use the June release version of Kepler: Just replace the Kepler p2 repository URL by http://download.eclipse.org/releases/kepler/201306260900/. This p2 repository is one of the sub-repositories that make up the full Kepler repository. (To see all the sub-repositories in the Kepler repository, check out the repository's compositeContent.jar.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top