Skip to main content
Jump to: navigation, search

Tycho/Dependency Resolution Troubleshooting

< Tycho
Revision as of 10:29, 26 September 2014 by T-oberlies.posteo.de (Talk | contribs) (More initial content)

This page aims to provide help with understanding and analyzing dependency resolution errors that you may see in a Tycho build.

Error messages from p2

At the core of its dependency resolution, Tycho uses the constraint satisfaction engine of p2, the Eclipse provisioning platform. In case of a dependency resolution failure, Tycho displays the diagnostic message generated by p2. Since p2 is normally used to create or update Eclipse installations, the messages may sound confusing at first, but they contain valuable information. This section provides hints how to read these messages.

Example dependency resolution error message:

[INFO] Resolving dependencies of MavenProject: com.mycorp:com.mycorp.myplugin:0.1.0-SNAPSHOT @ C:\Source\MyProject\com.mycorp.myplugin\pom.xml
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86_64, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.mycorp.myplugin 0.1.0.qualifier
[ERROR]   Missing requirement: com.mycorp.mylib 0.1.0.qualifier requires 'package org.eclipse.someproject [1.8.2,2.0.0)' but it could not be found
[ERROR]   Cannot satisfy dependency: com.mycorp.myplugin 0.1.0.qualifier depends on: bundle com.mycorp.mylib 0.0.0

Details:

  • Resolving dependencies of MavenProject ...
This line prints the Maven groupId, artifactId, and version and the file system location of the project being resolved.
  • Software being installed: ...
This line prints the seed of the dependency resolution, i.e. the artifact whose dependencies are being resolved. This is typically the main artifact of the project, but it could also be one of the artifacts specified as extraRequirements (TODO link to documentation).
  • Missing requirement: <artifact> requires '<dependency>' but it could not be found
This line prints one of the mandatory dependencies which cannot be resolved. This can either be a dependency of the seed artifact, or a dependency of an artifact which is a direct or transitive dependency of the seed artifact. How to read the dependency spec is explained below.
  • Cannot satisfy dependency: <artifact> depends on: <dependency>
In case the missing requirement is not on the seed artifact directly, the error message contains one or more of these lines. They trace the chain of dependencies from the seed artifact to the artifact with the missing requirement.

Understanding the missing requirement strings

Requirements in the p2 error messages consist of three parts: type (optional), ID, and version range.

When the requirement string includes a type, it is either package for an Import-Package dependency of a bundle, or bundle for Require-Bundle dependency of a bundle. In case the type is omitted, the requirement is specified in terms of the p2 ID of the required artifact (or more precisely, the ID of the "p2 installable unit"; installable units are the entities on which the p2 resolver works).

For most types of Eclipse artifacts, the p2 IDs are identical to the Eclipse IDs. So from an error message ... requires 'org.example.foo 0.0.0' but it could not be found you can read that the artifact on the left-hand side requires an artifact with p2 ID org.example.foo. Most likely, the requirement expects a bundle with this ID as Bundle-SymbolicName.

For features however, the p2 IDs differ from the Eclipse IDs: The p2 ID of a feature is the feature ID with a .feature.group suffix. So for example Missing requirement: com.mycorp.feature.feature.group 1.0.0.qualifier requires 'org.eclipse.rcp.feature.group 0.0.0' ... tells you that the feature com.mycorp.feature has an unresolved dependency to the feature org.eclipse.rcp.

Why can dependency XYZ not be resolved?

...

Back to the top