什么是p2存储库? [英] What is a p2 repository?

查看:294
本文介绍了什么是p2存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在在一个项目上工作了几个月,我们使用的是"p2-存储库".我知道我从他们那里得到了依赖.但是现在我想更深入地研究这个主题,我想知道到底是什么是p2存储库-定义.

我认为这与OSGi和Nexus有关.但是它是从哪里来的呢?使用p2存储库时是否绑定到Nexus?还是这是OSGi的通用标准?还是Eclipse/Maven/Tycho?

当我可以拥有Maven时,为什么需要p2-存储库?还是为什么我不能使用Maven?

解决方案

P2存储库在日食生态系统中非常常见.它们结合了工件(包),元数据,并且还可以包含蚀特征.

P2资料库通常完全独立于Maven资料库和联系. Nexus对p2功能提供了一些支持,这可能是您与之建立的联系.

在OSGi中提供部署的另一种方法是使用Apache Karaf功能.这些列出了要作为每个捆绑包的URL安装的捆绑包.这样的网址也可以是带有Maven坐标的mvn网址.在这种情况下,功能以及捆绑包都位于maven中.

第三种方法是使用OSGi捆绑软件存储库.这是OSGi标准,在bndtools中使用.它们只是托管元数据的索引和捆绑软件的网址.它可以与maven集成.

不幸的是,这些部署方式是互斥的.因此,您最好使用最适合您所开发平台的平台.因此,例如,如果您几乎所有的依赖项都来自eclipse项目,则p2是自然的.

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?

解决方案

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.

这篇关于什么是p2存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆