Hosting your Eclipse update site (P2) on Bintray.com

UPDATE: As of May 1, 2021 Bintray services will no longer be available (ConanCenter and JCenter are not affected) for more information read the Centers Deprecation Blog

 

Did you know you can easily host your Eclipse update site on Bintray.com?

After registering to Bintray (and optionally, creating or joining an organization), it’s as easy as 1-2-3:

  1. Use the predefined ‘generic’ repo (or create a new one) if you are generating a plain P2 update site, or ‘maven’ repo if you are generating a Tycho zipped site, and create a package for your site.
  2. Upload the Eclipse update site meta files (content.jar, artifacts.jar, etc. for site, or zip file with Tycho site) under the latest version, typically to the root path.
  3. Click on the “Set me up” button on the package page to get the necessary URL to use in Eclipse.

That’s pretty much it. Here’s an example:

Nodeclipse hosts their update site on Bintray:

Nodeclipse Eclipse update site on Bintray
Click to see Nodeclipse Eclipse update site on Bintray

In Eclipse, users just use the Bintray package link as an Update Site URL:

Install Bintray packages from eclipse
Install Bintray packages from eclipse

Cool, right? Well, almost :). Nodeclipse created an update site for each version (notice the ‘0.10.0’ at the end of the URL). It means that users may need to change this URL in their Eclipse settings for every new version released. That’s because up until recently you couldn’t override P2 metadata files.
But that’s not the case anymore! By using the REST API upload method you can always override P2 metadata files with new ones. Putting these files in the root of the repo lets users point at a permanent, single URL to configure Eclipse. Since these files are in the scope of the repository, i.e. do not belong to any package & version, the URL of the REST upload request should not include the package nor the version:

PUT /content/:subject/:repo/:file_path

Expect the upcoming release of Nodeclipse to follow this improvement :).

So here’s a win-win situation for you:
You get an awesome and free distribution platform with near-real time statistics, download-able request logs and and metadata.
Your users get lightening-fast downloads via a CDN directly from Eclipse, plus lots of new ways to get involved with your package. For example, the ability to follow organizations and users, or to review, rate and watch packages.

And oh, did we mention that Bintray is completely free to use for open-source packages?