Tool for managing/hosting own p2 repositories?

前端 未结 2 873
天涯浪人
天涯浪人 2020-12-13 09:16

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. W

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-13 09:25

    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.

提交回复
热议问题