Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a p2 repository?

I'm working on a project now for a few months where we use "p2-repositories". I know that I get my dependencies from them. But now I want do dive deeper into the subject and I wonder what exactly is a p2-repository - the definition.

I think it has something to do with OSGi and with Nexus. But where does it come from? Am I bound to Nexus when I use p2 repositories? Or is this the common standard from OSGi? Or Eclipse/Maven/Tycho?

Why do I need p2-repositories, when I can have Maven? Or why can't I use Maven?

like image 210
armin.miedl Avatar asked May 10 '17 14:05

armin.miedl


People also ask

What is p2 in Java?

p2 is a provisioning platform for Eclipse / Equinox based applications. The p2 platform itself is highly modular, meaning it can be carved and assembled in different ways depending on the task at hand.

What is p2 in Eclipse?

What is p2? p2 is a provisioning platform for Eclipse-based applications. It replaces the older Update Manager as the mechanism for managing an Eclipse installation. Provisioning is the act of finding and installing new functionality, and updating or removing existing functionality; it is distinct from building.

What is p2 maven?

GitHub - reficio/p2-maven-plugin: Maven3 plugin that automates the third-party dependency management for Eclipse RCP.

What is p2 update site?

A p2 repository is also called update site. p2 can refer to a repository via an URI which can point to a local file system or to a web server. If you build an Eclipse application, you also create an update site. This can for example be done with Maven Tycho.


1 Answers

P2 repositories are very common in the eclipse ecosystem. They combine the artifacts (bundles), the meta data and can also contain eclipse features.

P2 repositories are generally completely independent of maven repositories and nexus. Nexus has some support for p2 features which is probably the connection you have with it.

Another way of providing deployments in OSGi is using Apache Karaf features. These list the bundles to install as urls to each bundle. Such a url can also be a mvn url with maven coordinates. In this case the features as well as the bundles are located in maven.

A third way is to use OSGi bundle repositories. This is an OSGi standard and is used in bndtools. They just host the index of the meta data and a url to the bundle. It can be integrated with maven.

Unfortunately these ways of deployment are mutually exclusive. So you best use the one that is the most prominent for the platform you develop on. So for example if almost all of your dependencies are from eclipse projects then p2 is natural.

like image 82
Christian Schneider Avatar answered Sep 28 '22 00:09

Christian Schneider