Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 218
Iulian Dragos Avatar asked Sep 26 '12 12:09

Iulian Dragos


People also ask

What is a P2 repository?

The P2 repository format is a provisioning platform for Eclipse components. For more information about the P2 repository format, see the Equinox P2 documentation on the Eclipse Wiki. The following sections detail the procedures for creating and managing P2 repositories.

How do I install P2 repository?

To provision your install, select Help->Install New Software and select Add to add a new repository. Select Archive to point to the p2 repo archive you've downloaded from the build page. Select Open. You'll see the contents of the repository, identical to one on a remote http repository.


2 Answers

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.

like image 62
irbull Avatar answered Oct 21 '22 06:10

irbull


Yes, p2 is practically unusable without OSGi. However, if you need an example of small command line application using p2 API I suggest taking a look at p2diff. You may also find the following link interesting: Query Language for p2. If you really are dead set against using Equinox, you might try looking at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryIO.Parser and org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepositoryIO.Parser - it's just XML after all (albeit complicated).

like image 1
Jarek Przygódzki Avatar answered Oct 21 '22 05:10

Jarek Przygódzki