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

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?

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

    • It overrides the metadata files – content.jar and/or artifacts.jar. Inside those files there are pointers to the plugin jars, and those are changing according to the version.

  1. This is very cool! Or it would have been if it worked…

    If I try to upload files calles artifacts.jar or content.jar, they seem to disappear in a black hole. The version is created, but there are no files.

    If I try to upload some other files, it works ok, but they can not be “overwritten”. So I guess that there is some magic handling of artifacts.jar and content.jar – but why don’t they show in the files list?

    • Thanks for getting in touch! It definitely works, lots of Eclipse plugins are successfully hosted on Bintray by now. The best way to seek help with Bintray is using the feedback widget. Just click on the “feedback” tab on the right side of any Bintray.com page and you’ll be contacted shortly.

  2. FYI-
    The supported P2 metadata files are:
    contents.jar, artifacts.jar, compositeContents.jar, compositeArtifacts.jar, and p2.index
    Once uploaded using the REST API – these files are available in the download path, but are not visible in the UI. They can be overridden without limitation.

  3. A note on uploading the p2 metadata files using REST-
    Since these files are in the scope of the repository, i.e. do not belong to any package & version, the URL of the upload request should not include the package nor the version:
    PUT /content/:subject/:repo/:file_path

  4. With the pom snippet at https://gist.github.com/lonniev/8fe0903fa35c56add1ae I can easily upload a zipped p2 update site into my bintray repository. However, the zip is left un-exploded and is not published.

    Does anyone know of way to have the maven-wagon-plugin either pass additional HTTP query parameters or headers to ask Bintray to automagically explode and publish the zip or to have a peer plugin perform the additional REST calls to explode and publish the zip?

    The “goal” is to have “mvn deploy” fully automate the build, push, and publish of a new version of a p2 update site without having to have a build engineer visit bintray.com to make the uploaded site zip usable.

  5. What I would like to achieve is to have full separate p2 update sites, in different directories, e.g.

    1.0/artifacts.jar
    1.0/contents.jar
    1.0/features/…
    1.0/plugins/…

    1.1/artifacts.jar
    1.1/contents.jar
    1.1/features/…
    1.1/plugins/…

    thus when I upload with PUT I use the full /content/:subject/:repo/:package/:version/:file_path also for contents.jar and artifacts.jar… but I never achieve the desired structure… what I get instead is

    1.0/features/…
    1.0/plugins/…
    /artifacts.jar
    /contents.jar

    am I doing anything wrong?

    thanks in advance
    Lorenzo

  6. Pingback: Publish an Eclipse p2 composite repository on Bintray | Lorenzo Bettini

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s