DEV Community

Cédric Teyton for Packmind

Posted on • Edited on

Deploy a custom Eclipse Plugin on your Update Site

In late 2021 at Packmind (ex-Promyze), we released our first Eclipse plugin. In this post, we'll share with you how to deploy your plugin for your end-users.

We assume thus that you've already built your plugin, and it's ready to be deployed. Our starting point is just our plugin project:

Eclipse Plugin

We're now going to create our update site behind an Apache proxy.

Create a Feature Project

Click on File → New Project → Feature Project. Name your project as you want; in our case, we used promyzeEclipsePluginFeature. Next, add your plugin to the list.

Eclipse Plugin

Click on "Finish".

Now feel free to add any valuable elements in the "Informations" tab of the feature.xml view.

Eclipse Plugin

Create an Update Site

We need now to create an Update Site project. Click on File → New → Other → Update Site project.

Eclipse Plugin

Name it and click on Finish. At this point, you should have this kind of structure in your Project Explorer :

Eclipse Plugin

Deploy a new version of the Eclipse Plugin

In your plugin project, open the plugin.xml and update the version number. Save the file.

Eclipse Plugin

Next, on your Feature Project, open the feature.xml file and upgrade the version number as well. In our case, the feature has only one plugin, but you can include all the plugins you want. So you can follow an alternative scheme version. Save the file.

Eclipse Plugin

Next, right-click on the Feature Project, and select Export.

Eclipse Plugin

Select Deployable features, and click on Finish. This will take a few seconds. Then, open the Update Site project and the file site.xml. Add the feature you've just created. Finish the operation by clicking on Build All.

Eclipse Plugin

Now, your update site is ready on your machine. You can even add it to your current Eclipse instance!

It's time now to make this update site available to users. 🚀

Deploy an update site behind Apache

In this example, our update site will be stored on a standard Linux server. The update sites will be stored in this example in the /home/user/plugin-eclipse/ directory. We created the update-site directory and transferred the contents from our Update Site project there. You can do this through SCP, for instance, or/and automate this process with CI/CD pipelines. Here is the structure of the folder:

.
`-- update-site
    |-- artifacts.jar
    |-- content.jar
    |-- features
    |   `-- promyzeEclipsePlugin_1.0.10.beta.jar
    |-- plugins
    |   `-- promyzeEclipsePlugin_1.0.10.beta.jar
    `-- site.xml
Enter fullscreen mode Exit fullscreen mode

We need now to add a new Apache configuration site. Create a file /etc/apache2/sites-available/eclipse.promyze.com.conf (of course, change it depending on your context) :

<VirtualHost *:80>
        ServerName eclipse.promyze.com
        ServerAdmin contact@promyze.com

        DocumentRoot /home/user/plugin-eclipse/
</VirtualHost>
Enter fullscreen mode Exit fullscreen mode

Add the site :

sudo a2ensite eclipse.promyze.com.conf
Enter fullscreen mode Exit fullscreen mode

Update the Apache config to allow read permissions on your directory.

$> sudo nano /etc/apache2/apache2.conf
Enter fullscreen mode Exit fullscreen mode

Add this snippet at the end of the file:

<Directory /home/user/plugin-eclipse>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
Enter fullscreen mode Exit fullscreen mode

Let's reload Apache! ❤️‍🔥

$> sudo service apache2 reload 
Enter fullscreen mode Exit fullscreen mode

Now our update site is available but not secured:

Eclipse Plugin

Generate a certificate so that your update site will be available on HTTPS. In our case, we used letsencrypt. We're now secured!

Eclipse Plugin

That's it! 🤗 Your users can now add your update site (in our case, https://eclipse.promyze.com/update-site).

Top comments (2)

Collapse
 
ozkanpakdil profile image
özkan pakdil

thanks for this article and I managed to build my first eclipse plugin and publish it on github github.com/ozkanpakdil/IntelliJIde... , I wonder is there a way to automatize these manual steps for generating update site and building the plugin ?

Collapse
 
cteyton profile image
Cédric Teyton

Thanks! I currently do not know to be honest, that is my next step :-)
Hopefully it is!