Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Equinox/p2/p2 index

< Equinox‎ | p2
Revision as of 09:40, 27 May 2011 by Pascal.sonatype.com (Talk | contribs) (What is the p2.index file?)

What is the p2.index file?

The p2.index file provides a description of the kind of repository available at a particular location. This file is located next to the p2 metadata files (compositeContent.jar, content.jar, ...) that it describes. It is a java property file.

The presence of this file in a repository will cause p2 to replace its default lookup order for repository to match the one specified in the file. For example the example below will cause the content.xml repository to always be looked up first, and to never consult any other repository type.

 version = 1 
 artifact.repository.factory.order = artifacts.xml, ! 
 metadata.repository.factory.order = content.xml, !

How does it help me?

As a provider of a repository, it does not help you directly, but it helps your users to get a better experience and also slightly reduce the number of hits your server will be subject to.

What happens if I get it wrong ?

Should you get the content of this file wrong, the repository will fail loading. For example specifying compositeContent.xml where the repository is a content.xml will cause p2 to only look for compositeContent.xml and never look at the content.xml.

How many files for composite repositories

Given that a composite repository is just a repository that refers to other repositories, the full benefit of p2.index can only be achieved if every child repo has the file.

Jar vs XML extension

Example for composite repository

Example for simple repository

 version = 1
 artifact.repository.factory.order = artifacts.xml, !
 metadata.repository.factory.order = content.xml, !

Back to the top