Tool for managing/hosting own p2 repositories?

2019-01-21 16:08发布

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

2条回答
一纸荒年 Trace。
2楼-- · 2019-01-21 16:40

Maybe this is a bit late, but I am currently working on an open source (EPL) repository manager which supports the workflow of deploying to a repository with maven and tycho, and consuming it as P2 repository.

It is also possible to deploy bundles created by maven (not maven tycho) and the P2 metadata will be generated automatically.

The project is called "Package Drone" and hosted on github. There is also a short introduction video.

查看更多
来,给爷笑一个
3楼-- · 2019-01-21 16:48

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.

查看更多
登录 后发表回答