Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for managing/hosting own p2 repositories?

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

like image 209
Maksim Sorokin Avatar asked Dec 03 '10 11:12

Maksim Sorokin


People also ask

What is a p2 repository?

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.

What is a repository manager?

A repository manager is a dedicated server application designed to manage repositories of binary components. The usage of a repository manager is considered an essential best practice for any significant usage of Maven.

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 Nexus repository manager?

"Nexus is a repository manager. It allows you to proxy, collect, and manage your dependencies so that you are not constantly juggling a collection of JARs. It makes it easy to distribute your software. Internally, you configure your build to publish artifacts to Nexus and they then become available to other developers.


1 Answers

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.

like image 72
oberlies Avatar answered Sep 21 '22 04:09

oberlies