Am I forced to use Maven to create a plugin?

Hi,

I have an app that I would like to convert to a plugin but I dont use
maven. Im using also closed source so I have to install the jars from files
and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

You can use whatever you want to construct a plugin jar. My first plugin
was written in Scala and I used SBT for the build process.

--
Ivan

On Wed, May 1, 2013 at 2:09 PM, David G Ortega g.ortega.david@gmail.comwrote:

Hi,

I have an app that I would like to convert to a plugin but I dont use
maven. Im using also closed source so I have to install the jars from files
and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Ivan,

thanks for the reply. As far I understand the only thing I have to set up
is the es-plugin.properties so I have set up a sample project on eclipse
that goes like this:

src/es-plugin.properties
src/org/java-code-here

I export the jar file and I drop it into plugins folder I
start elasticsearch and throws a classnotfoundexception

[2013-05-02 01:01:23,086][WARN ][plugins ] [Ramrod] failed
to load plugin from
[jar:file:/C:/Stack/elasticsearch-0.19.9/lib/test.jar!/es-plugin.properties]
java.lang.ClassNotFoundException: org.example.elasticseach.plugin.TestPlugin

the content of es-plugin.properties is
plugin= org.example.elasticseach.plugin.TestPlugin

The only issue that I can think is that Im using java.exe in windows
enviroment and ES can not resolve the classpath... Any idea?

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use
maven. Im using also closed source so I have to install the jars from files
and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Not sure it's your concern here but try to remove the space after = sign:

plugin=org.example.elasticseach.plugin.TestPlugin

BTW, why don't you want to use Maven?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 2 mai 2013 à 01:11, David G Ortega g.ortega.david@gmail.com a écrit :

Hi Ivan,

thanks for the reply. As far I understand the only thing I have to set up is the es-plugin.properties so I have set up a sample project on eclipse that goes like this:

src/es-plugin.properties
src/org/java-code-here

I export the jar file and I drop it into plugins folder I start elasticsearch and throws a classnotfoundexception

[2013-05-02 01:01:23,086][WARN ][plugins ] [Ramrod] failed to load plugin from [jar:file:/C:/Stack/elasticsearch-0.19.9/lib/test.jar!/es-plugin.properties]
java.lang.ClassNotFoundException: org.example.elasticseach.plugin.TestPlugin

the content of es-plugin.properties is
plugin= org.example.elasticseach.plugin.TestPlugin

The only issue that I can think is that Im using java.exe in windows enviroment and ES can not resolve the classpath... Any idea?

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use maven. Im using also closed source so I have to install the jars from files and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David, thanks for the reply!!

In the code the space does not exists. Definetely has to be the classpath.
I don't use Maven just because I use a lot of propietary source and I can
not put that code in maven central, I would have to install all the files
in Maven or create a private repo...

Im going to prepare Ivan's code sample in an eclipse project and post it
here and see...

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use
maven. Im using also closed source so I have to install the jars from files
and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

IMHO, as soon as org.example.elasticseach.plugin.TestPlugin.class exists in your test.jar file, it should work.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 2 mai 2013 à 10:15, David G Ortega g.ortega.david@gmail.com a écrit :

Hi David, thanks for the reply!!

In the code the space does not exists. Definetely has to be the classpath.
I don't use Maven just because I use a lot of propietary source and I can not put that code in maven central, I would have to install all the files in Maven or create a private repo...

Im going to prepare Ivan's code sample in an eclipse project and post it here and see...

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:
Hi,

I have an app that I would like to convert to a plugin but I dont use maven. Im using also closed source so I have to install the jars from files and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David,

I checked the jar and its right there with the proper manifesto files and
the es-plugin.properties file...
I think this has to be one of those classnotfoundexception errors regarding
to the classpath like the well known jdbc error...
Urlclassloader.run does not know where to find it I have even setted the
classpath manually but it does not work...

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use
maven. Im using also closed source so I have to install the jars from files
and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Can you upload somewhere your jar file?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 2 mai 2013 à 10:57, David G Ortega g.ortega.david@gmail.com a écrit :

Hi David,

I checked the jar and its right there with the proper manifesto files and the es-plugin.properties file...
I think this has to be one of those classnotfoundexception errors regarding to the classpath like the well known jdbc error...
Urlclassloader.run does not know where to find it I have even setted the classpath manually but it does not work...

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use maven. Im using also closed source so I have to install the jars from files and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

To use Maven, you do NOT need to put code in Maven Central, and also,
you do NOT have to install all the files in Maven or create a private repo.
Just install Maven from Apache site and execute "mvn install", this will
do everything, it will download all dependencies into $HOME/.m2 - it is
absolutely no effort, beside the first run which will take a few minutes.

This is most convenient, since with ant, you have to spend a lot of your
time sorting out the inclusion od ES jars, the ES dependency jars, the
ES optional jars etc.

But this convenience is not a Maven specific feature. So do not worry.

Let me explain how ES looks for classpath-based plugins when it starts
up by executing bin/elasticsearch.

  • in the shell script, the JVM is instructed to use all jars in
    $ES_HOME/lib/*.jar as class path. So you can safely put jars with
    es-plugin.properties in the root folder into the $ES_HOME/lib folder and
    it will be picked up being on the class path. But this is not
    recommended, because you mix up the core code with plugin code, which is
    bad for maintainability.

  • before ES node is started, the PluginManager of ES adds
    classpath-based plugins also by retrieving es-plugin.properties from
    jars in the configurable plugin path in the file system folders
    $ES_HOME/plugins//. To adjust this, just set a path.plugins
    directive in $ES_HOME/config/elasticsearch.yml (or on command line)

Jörg

Am 02.05.13 10:15, schrieb David G Ortega:

Hi David, thanks for the reply!!

In the code the space does not exists. Definetely has to be the classpath.
I don't use Maven just because I use a lot of propietary source and I
can not put that code in maven central, I would have to install all
the files in Maven or create a private repo...

Im going to prepare Ivan's code sample in an eclipse project and post
it here and see...

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont
use maven. Im using also closed source so I have to install the
jars from files and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Jorg, thanks for the reply!!

I tried also droping the jars into the lib folder of ES. Finally was a
corruption of the eclipse project. I started a new project, copied the
files into the new one and exported the jar... voila the plugin was working
like a charm. I realized it just because when I just tried a instantiation
of the plugin class inside a main method eclipse raised an exception in the
main thread. Weird...

I was thinking to set up a github project with an eclipse template project
with Ivan's Helloworld plugin for not maveners... Also that will break the
believe of many people that really think that ES is forced to be with
maven... I have read soooooo many blogs telling you that, about 5 of 8
plugin tutorials do really believe that you have to have that maven and
folder structure. In fact I dont really understand also why all plugin
contributors are releasing the plugins inside the org.elasticsearch
package... I prefer to use my package name...

What do you think guys about that?

Thanks all!!

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use
maven. Im using also closed source so I have to install the jars from files
and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

why all plugin contributors are releasing the plugins inside the
org.elasticsearch package... I prefer to use my package name...
Copy & paste effect. When I started to write some plugins, I just cloned existing plugins and keep them in org.elasticsearch package.

For newer plugins, I started to use my own package name.

About Maven, I found very easy to create the final assembly (ZIP) when it came to dependencies.
If it's a standalone plugin, it's probably easy to build it without Maven.

That said, Maven is now somehow a defacto standard tool, as 'make' is... That's probably the reason so many authors use it now when they want to open source the project and gain contributors.
No need to say that if you release one day your project, I won't be able to patch it quickly as I don't use Eclipse and I don't have Ant.

My 2 cents,
Best

David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 3 mai 2013 à 02:06, David G Ortega g.ortega.david@gmail.com a écrit :

Hi Jorg, thanks for the reply!!

I tried also droping the jars into the lib folder of ES. Finally was a corruption of the eclipse project. I started a new project, copied the files into the new one and exported the jar... voila the plugin was working like a charm. I realized it just because when I just tried a instantiation of the plugin class inside a main method eclipse raised an exception in the main thread. Weird...

I was thinking to set up a github project with an eclipse template project with Ivan's Helloworld plugin for not maveners... Also that will break the believe of many people that really think that ES is forced to be with maven... I have read soooooo many blogs telling you that, about 5 of 8 plugin tutorials do really believe that you have to have that maven and folder structure. In fact I dont really understand also why all plugin contributors are releasing the plugins inside the org.elasticsearch package... I prefer to use my package name...

What do you think guys about that?

Thanks all!!

El miércoles, 1 de mayo de 2013 23:09:51 UTC+2, David G Ortega escribió:

Hi,

I have an app that I would like to convert to a plugin but I dont use maven. Im using also closed source so I have to install the jars from files and deal with that mess.
Am I forced to use maven to create ES plugins?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I think we need a summary and an update of all the notes kimchy has
already given about plugin development.

Of course it is possible to write ES plugin development tutorials for
ant, ivy, gradle etc. The reason why maven is documented better is that
ES itself is built with maven and nobody likes to reinvent the wheel.
Maven is easy to use, it manages dependencies automatically (once the ES
jars are in Maven central repo your maven for plugin development can
fetch the current version from there), there is command line support, it
works on every OS out of the box, and there is vast IDE support, so you
can start your favorite IDE and you are right in the middle of
developing with ES :slight_smile:

The package name convention has never been an issue. My opionion is, it
should be org.elasticsearch for the core team, just to assist the
community members in identifying the code origin better.

The package name selection of my plugins are dating back before the
founding of the company so it was just by copying from kimchy's example
plugins without considering a suitable naming strategy. But I will
switch to org.xbib.elasticsearch asap...

Jörg

Am 03.05.13 02:06, schrieb David G Ortega:

I have read soooooo many blogs telling you that, about 5 of 8 plugin
tutorials do really believe that you have to have that maven and
folder structure. In fact I dont really understand also why all plugin
contributors are releasing the plugins inside the org.elasticsearch
package... I prefer to use my package name...

What do you think guys about that?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.