用于管理/托管自己的p2存储库的工具? [英] Tool for managing/hosting own p2 repositories?

查看:172
本文介绍了用于管理/托管自己的p2存储库的工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们公司使用Maven。我们使用 Nexus 存储库管理器来存储我们的快照和版本。



目前,我们正在开发基于Eclipse的产品。我们使用 Tycho 来做到这一点。



问题如下:在我们的基于Eclipse的产品中,我们有很多功能。我们的想法是分别构建每个功能(或功能组),并将它们放在内部p2存储库中。当一个功能需要另一个功能时,我们将目标平台指向必要的内部p2存储库。



目前,我们使用Tycho构建应用程序。我们使我们的功能可部署,所以Tycho在目标中生成一个P2站点。我们将P2站点推送到我们的服务器,然后运行Eclipse FeaturesAndBundlesPublisher ,将最近构建的功能与P2存储库合并。因此,我们有一个内部的P2存储库,具有所需的功能的所有版本。



我们发现这个过程太麻烦了。有没有像Nexus这样的工具,这样会更方便吗?



UPD :有一个关于Tycho Users列表的讨论

解决方案

使用解压存储库Nexus插件,您可以使用 Nexus 用于在Tycho版本之间交换二进制文物。




  • Tycho项目A发布其工件像一个普通的Maven项目:该项目是使用 mvn clean deploy 构建的,它上传项目的工件进入Nexus上的部署Maven 存储库。唯一的特殊要求是项目构建了一个 p2 存储库。推荐的方法是一个 eclipse-repository 模块,但在大多数情况下,可部署功能也可以起作用。


  • 在您的Nexus上,您只需要以下一次性配置:对于部署Maven存储库(或包含该存储库的存储库组),您需要添加Unzip类型的虚拟存储库库。该虚拟存储库以未打包的形式显示来自部署存储库的zip工件。



    示例:如果项目A的p2版本库zip位于部署Maven存储库中的 HTTP://nexus.corp/nexus/repositories/build.milestones/corp/example/project-a/project-a-repo/1.0.0/project-a-repo-1.0.0.zip ,它将在Unzip Repository中的标准p2存储库格式中以 http://nexus.corp/nexus/repositories/build.milestones.unzip/corp/example/project-a提供/project-a-repo/1.0.0/project-a-repo-1.0.0.zip-unzip /


  • Tycho项目B可以通过将后一个URL添加到其目标平台中来引用项目A的工件,例如在目标定义文件中。




在上面的例子中,项目B引用了项目A的发行版本。方法也适用于快照,因为解压存储库支持符号版本,例如 1.1.0-SNAPSHOT ,用于最后部署的1.1.0-SNAPSHOT,甚至只有 SNAPSHOT 。然后,使用这些符号版本,项目B可以例如在其自己的CI构建中,通过在目标平台中添加生成的(stable!)p2存储库URL来引用CI构建结果项目A.



免责声明:解压存储库Nexus插件是Tycho项目的一部分,其中我是提交者。


Our company uses Maven. We use the Nexus repository manager in order to store our snapshots and releases.

Currently, we are developing a product based on Eclipse. We use Tycho to do that.

The problem is the following: In our Eclipse-based product we have many features. Our idea is build each feature (or group of features) separately and put them in internal p2 repositories. When one features requires another feature, we point the target platform to necessary internal p2 repository.

Currently, we build application with Tycho. We make our features "deployable", so Tycho produces a P2 site in target. We push that P2 site to our server and then run Eclipse FeaturesAndBundlesPublisher, which merges that recently-built feature with a P2 repository. As a result, we have a internal P2 repository having all the versions of required feature.

We find that this process is too cumbersome. Is there a tool like Nexus, which would be more convenient?

UPD.:There is a discussion on Tycho Users list

解决方案

With the Unzip Repository Nexus Plugin, you can use Nexus for exchanging binary artifacts between Tycho builds.

  • Tycho project A publishes its artifacts like a normal Maven project: The project is built with mvn clean deploy, which uploads the project's artifacts into your deploy Maven repository on the Nexus. The only special requirement is that the project builds a p2 repository. The recommended way to do this is an eclipse-repository module, but a "deployable feature" should also work in most cases.

  • On your Nexus, you only need the following one-time configuration: For the deploy Maven repository (or a "Repository Group" which includes that repository), you need to add a virtual repository of type "Unzip Repository". This virtual repository shows zip artifacts from the deploy repository in unpacked form.

    Example: If the p2 repository zip of project A is in the deploy Maven repository at http://nexus.corp/nexus/repositories/build.milestones/corp/example/project-a/project-a-repo/1.0.0/project-a-repo-1.0.0.zip, it will be available in standard p2 repository format in the Unzip Repository at http://nexus.corp/nexus/repositories/build.milestones.unzip/corp/example/project-a/project-a-repo/1.0.0/project-a-repo-1.0.0.zip-unzip/.

  • Tycho project B can reference the artifacts from project A by adding the latter URL to its target platform, e.g. in a target definition file.

In the above example, project B references a release version of project A. The same approach also works for snapshots because the Unzip Repository has support for "symbolic" versions, like 1.1.0-SNAPSHOT for the last deployed 1.1.0-SNAPSHOT or even just SNAPSHOT for the overall highest version. Using these symbolic versions, Project B can then, for example in its own CI build, reference the CI build results project A by adding the resulting (stable!) p2 repository URLs in its target platform.

Disclaimer: The Unzip Repository Nexus Plugin is part of the Tycho project, of which I'm a committer.

这篇关于用于管理/托管自己的p2存储库的工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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