Script and data around the Eclipse Platform artifacts published on maven central.

URLs

Do you want to improve this page? Please edit it on GitHub.

Background

Eclipse components (sometime called plugin or bundle) are available on a P2 Update site. With each release a new update site identified by its URL is created to publish the jars.

The P2 Update sites are less common than Maven Repositories used by Maven and Gradle. The most famous repository is probably maven central.

In 2017 with Eclipse Release Neon.2, Stephan Herrmann presented his work to republish some of jars of the release Update Site to maven central.

An important part of this work is to transform the layout (where the Jars are located) and the metadata (what are the dependencies of each jar). In a Maven Repository the metadata are stored in a *.pom file associated with each jar. Especially the Require-Bundle and Import-Package entries of the MANIFEST.MF are transformed to dependency indication in the *.pom file. The tool used to perform this task is called CBI Aggregator and the setup to publish to maven central is defined in the eclipse.platform.releng project.

BOM files

On maven central you do not have the notion of Eclipse Releases. All artifacts are stored next to each other, under unique coordinates (GroupId, ArtiactId and Version).

Because of the open version ranges in the *.pom file, it is hard to select a specific version of a jar with its transitive dependency corresponding to the same Eclipse Release.

This is where the BOM (bill of materials) files produced by this repository can be useful.

They are published in the repo/ folder following a maven repository layout. This way, the raw file viewer of GitHub is a valid maven repository.

https://raw.githubusercontent.com/jmini/ecentral/HEAD/repo

If you prefer a more stable version you can use any commit identified by its commit-id or by a tag. For the latest released version of this repository (1.1.1) use:

https://raw.githubusercontent.com/jmini/ecentral/1.1.1/repo

The coordinates of the different bom file use the format:

<dependency>
  <groupId>fr.jmini.ecentral</groupId>
  <artifactId>eclipse-platform-dependencies</artifactId>
  <version>${eclipseReleaseVersion}</version>
</dependency>

Where ${eclipseReleaseVersion} correspond to the platform version of the Eclipse release.

Eclipse Release Name Eclipse Release Version

2022-03

4.23

2021-12

4.22

2021-09

4.21

2021-06

4.20

2021-03

4.19

2020-12

4.18

2020-09

4.17

2020-06

4.16

2020-03

4.15

2019-12

4.14

2019-09

4.13

2019-06

4.12

2019-03

4.11

2018-12

4.10

2018-09

4.9

Photon

4.8

Oxygen

4.7

Neon

4.6

Gradle usage example

Add the repository to your repositories section:

repositories {
    maven {
        url 'https://raw.githubusercontent.com/jmini/ecentral/HEAD/repo'
    }
    mavenCentral()
}

Declare the BOM file as platform dependency inside the platform section:

dependencies {
    implementation platform('fr.jmini.ecentral:eclipse-platform-dependencies:4.14')
    implementation 'org.eclipse.jdt:org.eclipse.jdt.core' (1)
    // other dependencies...
}
1 the JDT dependency is in the platform. The version is not specified here, Gradle will pick the one defined in the BOM file.

Check the complete project in the jdt-gradle-example folder.

Maven usage example

Add the repository to your <repositories> section:

<repositories>
  <repository>
    <id>ecentral</id>
    <url>https://raw.githubusercontent.com/jmini/ecentral/HEAD/repo</url>
  </repository>
</repositories>

Declare the BOM file inside the <dependencyManagement> section:

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>fr.jmini.ecentral</groupId>
      <artifactId>eclipse-platform-dependencies</artifactId>
      <version>4.14</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Check the complete project in the jdt-maven-example folder.

Source Code

The code used to generate the data can be found the src/ folder.

A unit-test class (called fr.jmini.utils.ecentral.RunTest) is used to generate all the BOM files.

Example test:

@Test
void run_4_14() throws Exception {
    Input input = new Input()
            .withReleaseName("2019-12")
            .withReleaseVersion("4.14")
            .withUpdateSite("https://download.eclipse.org/eclipse/updates/4.14/");
    new ECentralTask(input).run();
}

It produces following pom file: <git repo root>/repo/fr/jmini/ecentral/eclipse-platform-dependencies/4.14/eclipse-platform-dependencies-4.14.pom

Intermediate steps results are stored as file under: <git repo root>/data/4.14. The files are reused to compute the next step. They have to be deleted to rerun the complete process from scratch.

Build

This project is using gradle.

Command to build the sources locally:

./gradlew build

Command to build the documentation page:

./gradlew asciidoctor

The output of this command is an HTML page located at <git repo root>/build/docs/html5/index.html.

For project maintainers

Command to upload the documentation page on GitHub pages:

./gradlew gitPublishPush

Command to perform a release:

./gradlew release -Prelease.useAutomaticVersion=true

Using ssh-agent

Some tasks requires to push into the distant git repository (release task or updating the gh-pages branch). If they are failing with errors like this:

org.eclipse.jgit.api.errors.TransportException: ... Permission denied (publickey).

Then ssh-agent can be used.

eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa

(source for this approach)

Similar projects

The mavencentral plugin

Inside a Gradle build, the com.diffplug.eclipse.mavencentral plugin from the goomph project offers with constrainTransitivesToThisRelease() a mechanism to set the version of all transitive dependencies to be the one from a given Eclipse release.

Get in touch

Use the ECentral issue tracker on GitHub.

You can also contact me on Twitter: @j2r2b

License