Search code examples
eclipse-pluginp2

Where can I find the p2 repository specification?


I tried googling left and right, and couldn't find a specification for the p2 repository format that Eclipse is using.

I am interested in reading p2 metadata (content.xml/jar and artifacts.xml/jar) and I'd like to know their grammar, the repository layout (composite vs simple, etc.)

I can, of course, reverse-engineer this by looking at a few existing repositories, but I'd like to know if there is a document that describes this in detail.


Solution

  • The format of these files is not considered API, and as such, there is no specification. These are actually just one such format for p2 repositories, and you can plug-in your own format if you'd like. The only API for the repository format is an implementation of IMetadataRepository and IArtifactRepository.

    If you would like to process these files, I suggest loading the repositories (using the IMetadataRepositoryManager and IArtifactRepositoryManager) and using the API these interfaces expose.