# What's the proper way to upload a plugin?

**URL:** <https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313>\
**Category:** Elasticsearch\
**Created:** [September 6, 2011, 10:21am UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313 "2011-09-06T10:21:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt1/32/2986_2.png) [@Matt1](https://discuss.elastic.co/u/Matt1)\
**Post date:** [September 6, 2011, 10:21am UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/1 "2011-09-06T10:21:31Z")

</div>

I packaged a new (better?) Chinese analyzer as a plugin:

> **[thmttch/elasticsearch](https://github.com/thmttch/elasticsearch)**
>
> elasticsearch - Adds the SmartChineseAnalyzer as a plugin.

However, I'm not sure what's the best way to upload this so that  
`plugin -install analyzer-smartchinese` just works. Right now, you  
have to:

plugin -url [https://github.com/downloads/thmttch/elasticsearch/elasticsearch-analysis-smartchinese-0.18.0-SNAPSHOT.zip](https://github.com/downloads/thmttch/elasticsearch/elasticsearch-analysis-smartchinese-0.18.0-SNAPSHOT.zip)  
-install analysis-smartchinese

From reading PluginManager, I don't see anyway to have a different  
version number than what ES is using, or am I just being obtuse?

If somebody can help me test it (it works for me, but that never  
proves anything), that would be nice as well; this is my first time  
hacking on ES.

RE: [https://github.com/elasticsearch/elasticsearch/issues/1073](https://github.com/elasticsearch/elasticsearch/issues/1073)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 6, 2011, 10:38am UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/2 "2011-09-06T10:38:12Z")

</div>

There are two variants to plugins, the first, are the ones that comes built  
in elasticsearch, and the others, are ones hosted outside of elasticsearch.

In 0.17, there was push to try and create more external friendly plugin  
system. The hope is that the built in plugins in elasticsearch will slowly  
move to their own projects (hosted on github) and installed directly from  
there.

The idea is that you create the plugin as a project (on github for example).  
No need to fork the full elasticsearch codebase, just add it as a dependency  
so you can build and package your plugin. You can choose your own build  
system (maven, gradle, ant) for that.

The packaging of the plugin should end up generating a zip file that is  
similar in nature to the other plugins. The simplest include the plugin and  
dependencies jar files within it.

Once you have that, you can upload the zip file to github. You can (and  
should) use your own versioning, you don't have to use elasticsearch  
versioning (cause then you will need to release a new plugin version each  
time elasticsearch is released).

Lets say your username is `sexy`, and your plugin repo name is `beast` (on  
github).

The file you end up storing on github (under downloads) should be named  
something like: beast-0.4.zip (0.4 is the version number). You can  
potentially prefix it with either elasticsearch or es, for example:  
elasticsearch-beast-0.4.zip. Then, installing it is simple:

bin/plugin -install sexy/beast/0.4

One thing that I would love to get into the elasticsearch repo is a plugin  
template, that includes the template files, with build all configured (using  
maven or gradle). So you can just get that template and start writing a  
plugin easily.

On Tue, Sep 6, 2011 at 1:21 PM, Matt [matt.chu@gmail.com](mailto:matt.chu@gmail.com) wrote:

> I packaged a new (better?) Chinese analyzer as a plugin:
> 
> [https://github.com/thmttch/elasticsearch](https://github.com/thmttch/elasticsearch)
> 
> However, I'm not sure what's the best way to upload this so that  
> `plugin -install analyzer-smartchinese` just works. Right now, you  
> have to:
> 
> plugin -url  
> [https://github.com/downloads/thmttch/elasticsearch/elasticsearch-analysis-smartchinese-0.18.0-SNAPSHOT.zip](https://github.com/downloads/thmttch/elasticsearch/elasticsearch-analysis-smartchinese-0.18.0-SNAPSHOT.zip)  
> -install analysis-smartchinese
> 
> From reading PluginManager, I don't see anyway to have a different  
> version number than what ES is using, or am I just being obtuse?
> 
> If somebody can help me test it (it works for me, but that never  
> proves anything), that would be nice as well; this is my first time  
> hacking on ES.
> 
> RE: [Adding SmartChineseAnalyzer to ElasticSearch · Issue #1073 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1073)

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 6, 2011, 1:33pm UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/3 "2011-09-06T13:33:44Z")

</div>

On Tue, Sep 6, 2011 at 6:38 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> The file you end up storing on github (under downloads) should be named  
> something like: beast-0.4.zip (0.4 is the version number). You can  
> potentially prefix it with either elasticsearch or es, for example:  
> elasticsearch-beast-0.4.zip. Then, installing it is simple:  
> bin/plugin -install sexy/beast/0.4

Github plugins will not accept a filename that starts with "elasticsearch- "  
[https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/plugins/PluginManager.java#L101](https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/plugins/PluginManager.java#L101)

The inverse holds true for plugins installed locally.

> One thing that I would love to get into the elasticsearch repo is a plugin  
> template, that includes the template files, with build all configured (using  
> maven or gradle). So you can just get that template and start writing a  
> plugin easily.

That would be great. I was thinking about plugins lately and if it was  
possible to execute a certain task. I was able to do it and I wanted  
to share my results. However, I wanted to write the code in Java  
instead of Scala so that more people can understand it. My only  
limitation was that I needed to learn gradle (not hard, just did not  
have the time). A sample gradle build file for plugins would be  
great, especially when it comes to packaging.

--  
Ivan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 6, 2011, 1:38pm UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/4 "2011-09-06T13:38:22Z")

</div>

On Tue, Sep 6, 2011 at 4:33 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> On Tue, Sep 6, 2011 at 6:38 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > The file you end up storing on github (under downloads) should be named  
> > something like: beast-0.4.zip (0.4 is the version number). You can  
> > potentially prefix it with either elasticsearch or es, for example:  
> > elasticsearch-beast-0.4.zip. Then, installing it is simple:  
> > bin/plugin -install sexy/beast/0.4
> 
> Github plugins will not accept a filename that starts with "elasticsearch-  
> "
> 
> [https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/plugins/PluginManager.java#L101](https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/plugins/PluginManager.java#L101)

The name is just removed so it won't be "installed" using that name, but  
just using the descriptive name, the download link will include  
elasticsearch-.

> The inverse holds true for plugins installed locally.
> 
> > One thing that I would love to get into the elasticsearch repo is a  
> > plugin  
> > template, that includes the template files, with build all configured  
> > (using  
> > maven or gradle). So you can just get that template and start writing a  
> > plugin easily.
> 
> That would be great. I was thinking about plugins lately and if it was  
> possible to execute a certain task. I was able to do it and I wanted  
> to share my results. However, I wanted to write the code in Java  
> instead of Scala so that more people can understand it. My only  
> limitation was that I needed to learn gradle (not hard, just did not  
> have the time). A sample gradle build file for plugins would be  
> great, especially when it comes to packaging.

It doesn't have to be gradle, it can be maven (for the plugin template).  
Probably the more common option for people.

> --  
> Ivan

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 6, 2011, 1:47pm UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/5 "2011-09-06T13:47:44Z")

</div>

On Tue, Sep 6, 2011 at 9:38 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> It doesn't have to be gradle, it can be maven (for the plugin template).  
> Probably the more common option for people.

I just needed an excuse to learn Gradle. 🙂 Plus, I have not touched  
Maven in over a year and do not want to! Technically, the  
scala-build-tool handles Java source files without an issue, but I  
would not want anyone to have to download a build system for a simple  
plugin.

--  
Ivan

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 6, 2011, 1:50pm UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/6 "2011-09-06T13:50:25Z")

</div>

How about a plugin template for scala users? Using sbt and all? Thats a  
great way forward... .

On Tue, Sep 6, 2011 at 4:47 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> On Tue, Sep 6, 2011 at 9:38 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > It doesn't have to be gradle, it can be maven (for the plugin template).  
> > Probably the more common option for people.
> 
> I just needed an excuse to learn Gradle. 🙂 Plus, I have not touched  
> Maven in over a year and do not want to! Technically, the  
> scala-build-tool handles Java source files without an issue, but I  
> would not want anyone to have to download a build system for a simple  
> plugin.
> 
> --  
> Ivan

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:55am UTC](https://discuss.elastic.co/t/whats-the-proper-way-to-upload-a-plugin/5313/7 "2017-07-06T03:55:09Z")

</div>


