Deploy a custom Eclipse Plugin on your Update Site
Tags: java, programming, productivity, tooling
Published: 2021-11-24 12:31:05

In late 2021 at [Packmind](https://packmind.com) (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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6lhp9653d5mwnfxdi9vb.png)


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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yb6d6unnzhayxe3kanhs.png)

Click on "Finish".

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

![Eclipse Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9kwxzb98oij0na5aqkp.png)


## Create an Update Site

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


![Eclipse Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ts265s0p633gjliys4e.png)


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

![Eclipse Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpjmbe918fr4sk1xibti.png)

## 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmxci2h54zmw2cnfz3zn.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q43a9z6tdwu1iyn24oeu.png)

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


![Eclipse Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8er4i6tb09j4jlgt0n1.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hc872sfsay94e4zy9jcq.png)

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:

```bash
.
`-- update-site
    |-- artifacts.jar
    |-- content.jar
    |-- features
    |   `-- promyzeEclipsePlugin_1.0.10.beta.jar
    |-- plugins
    |   `-- promyzeEclipsePlugin_1.0.10.beta.jar
    `-- site.xml
```

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) :

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

        DocumentRoot /home/user/plugin-eclipse/
</VirtualHost>
```

Add the site : 

```bash
sudo a2ensite eclipse.promyze.com.conf
```

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

```bash
$> sudo nano /etc/apache2/apache2.conf
```

Add this snippet at the end of the file:

```bash
<Directory /home/user/plugin-eclipse>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>
```

Let's reload Apache! ❤️‍🔥

```bash
$> sudo service apache2 reload 
```

Now our update site is available but not secured:

![Eclipse Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zcbptjfc1k8su1x0z8st.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/grhrslcp49ai67xfgxr8.png)

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