Solution for creating a standalone "composite" Eclipse update site with categories

This will be a rather long question, so bear with me. I am looking for a solution to create custom update sites (or p2 repositories) for use in a standalone development environment, bearing in mind the following:

  • Each site will contain a combination of third-party and custom Eclipse plugins.

  • I would like to create one site for each IDE configuration. for example, developers using Helios need to add only one update site containing m2e, Subversive, and CustomPluginA. Developers using Flash Builder can add another site containing m2e and CustomPluginB.

  • Since development is offline, we are currently mirroring third-party update sites using a script . Custom sites should draw plugins from these copies.

  • Our custom Eclipse plugins are currently built with Maven + Tycho on Jenkins. If possible, I would like to configure update sites to automatically build using Jenkins. Then, if the user plugin is updated, it can initiate the necessary builds of the update site.

  • Custom categories on update sites will be enjoyable.

I am trying to find the best and cleanest way to approach this. How can I install something like this using Tycho to create sites? Is Tycho the best option? I want third-party plugins to be copied to each site, or I want to create composite p2 repositories that point to each of the mirrored third-party sites. Is it possible to create custom categories with a p2 composite repository?

And finally, what is the easiest way to determine which plugins and features are included in the site? In Eclipse, I can create a site update project that simplifies editing, but I can only include plugins that exist in this Eclipse installation. Creating a site.xml or p2 ant script file manually solves this problem, but manually identifying installed identifiers and device versions is difficult and error prone.

Thanks for taking the time to read it all. If someone can solve all my problems, which would be awesome, and I probably have to add generosity to this issue.

+4
source share
1 answer

I suggest two ways: one with Tycho and one with B3 aggregator.

1) Tycho :

Step 1: Define the target platform using the built-in PDE tools that use your existing local update sites and save them as a .target file. You can then reference this file in your assembly as follows:

<plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>target-platform-configuration</artifactId> <version>${tycho.version}</version> <configuration> <resolver>p2</resolver> <target> <artifact> <groupId>org.eclipse.viatra2</groupId> <artifactId>«project name where the target file resides»</artifactId> <version>«artifact version»</version> <classifier>«target filename without extension»</classifier> </artifact> </target> <ignoreTychoRepositories>true</ignoreTychoRepositories> </configuration> </plugin> 

Step 2: Define the new project as an update site. The project should contain category.xml, referencing the used versions of the used functions of the target platform from the previous step. You can create this category.xml using the PDE category definition wizard / editor.

Step 3: Just publish your assembly using the update site archetype:

 <packaging>eclipse-repository</packaging> <build> <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-publisher-plugin</artifactId> <version>${tycho.version}</version> <configuration> <publishArtifacts>true</publishArtifacts> </configuration> </plugin> </plugins> </build> 

2) B3 Aggregator:

The Eclipse B3 project contains an aggregator function. Using an aggregator, you define a model that uses existing update sites, and then simply execute that model using the aggregator, and the result is an update site. In the latter case, you can either create a composite update site that relates to other update sites, or create a separate copy from the source data. The manual contains a simple example; it is easy to use.

3) Comparison

The definition of mirroring logic is more straightforward in B3, since the model contains only a description of the mirroring, and also allows you to create composite update sites that link only to existing sites. However, if you want to do anything else besides updating the site, then it is more difficult to do. In addition, it can be done in headless builds (for example, from Jenkins), but this requires the installation of a silent instance of Eclipse. The documentation contains details, but the tool is not standalone, as in the case of Maven / Tycho.

In the case of Tycho, it is more difficult to see the structure of the resulting update site, but the resulting assembly is more extensible (for example, you can just add your own functions using the same type of assembly) and you need to install Maven to build it.

Thus, all the tools can fit your needs - you need to evaluate your strengths and weaknesses in your case.

+4
source

Source: https://habr.com/ru/post/1392150/


All Articles