# ElasticSearch artifacts to use via Ant+Ivy and/or Maven

**URL:** <https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879>\
**Category:** Elasticsearch\
**Created:** [March 30, 2010, 12:17pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879 "2010-03-30T12:17:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paolo\_Castagna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paolo_castagna/32/3347_2.png) [@Paolo\_Castagna](https://discuss.elastic.co/u/Paolo_Castagna)\
**Post date:** [March 30, 2010, 12:17pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/1 "2010-03-30T12:17:52Z")

</div>

Hi,  
are the ElasticSearch artifacts published to any Maven/Ivy repository?

What are the jars needed to use the ElasticSearch Java APIs?

Paolo

---

<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:** [March 30, 2010, 3:56pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/2 "2010-03-30T15:56:27Z")

</div>

No, not yet. I am trying to get it published to central, as usual, its a  
pain. The jar files it needs are basically the ones listed under the lib  
directory.

-shay.banon

On Tue, Mar 30, 2010 at 3:17 PM, Paolo Castagna \<  
[castagna.lists@googlemail.com](mailto:castagna.lists@googlemail.com)\> wrote:

> Hi,  
> are the Elasticsearch artifacts published to any Maven/Ivy repository?
> 
> What are the jars needed to use the Elasticsearch Java APIs?
> 
> Paolo

---

<div class="post-metadata">

**Author:** ![Paolo\_Castagna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paolo_castagna/32/3347_2.png) [@Paolo\_Castagna](https://discuss.elastic.co/u/Paolo_Castagna)\
**Post date:** [March 30, 2010, 4:42pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/3 "2010-03-30T16:42:59Z")

</div>

Shay Banon wrote:

> No, not yet. I am trying to get it published to central, as usual,  
> its a pain.

It would be nice for all the Elasticsearch users to be able to say:

 com.elasticsearch elasticsearch 0.5.1 

or:

... and have Maven or Ivy (or something else :-)) resolve and manage  
the dependencies for them.

I have never used Gradle, but it does not seem to be too painful.  
Perhaps the pains are coming from somewhere else. 🙂

Is there something I can do to help on this?

> The jar files it needs are basically the ones listed under the lib  
> directory.

Are all necessary even if I just want to use the Java client APIs?

Thanks,  
Paolo

---

<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:** [March 30, 2010, 7:43pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/4 "2010-03-30T19:43:34Z")

</div>

On Tue, Mar 30, 2010 at 7:42 PM, Paolo Castagna \<  
[castagna.lists@googlemail.com](mailto:castagna.lists@googlemail.com)\> wrote:

> Shay Banon wrote:
> 
> > No, not yet. I am trying to get it published to central, as usual,
> > 
> > its a pain.
> 
> It would be nice for all the Elasticsearch users to be able to say:
> 
> com.elasticsearch elasticsearch 0.5.1 
> 
> or:
> 
> ... and have Maven or Ivy (or something else :-)) resolve and manage  
> the dependencies for them.

Publishing to maven central is more complex than just creating the  
deliverables (which do need munging when using gradle). The above is what it  
means to publish to an online repository.

> I have never used Gradle, but it does not seem to be too painful.  
> Perhaps the pains are coming from somewhere else. 🙂

As usual with maven, its coming from most/all places. Gradle does poses  
challenges to create proper distributions, but then just getting it to  
central is another pain.

> Is there something I can do to help on this?

Not in this case. Its not technical problems.

> The jar files it needs are basically the ones listed under the lib
> 
> > directory.
> 
> Are all necessary even if I just want to use the Java client APIs?

If you use the server client, then yes. Is there a problem with it?

> Thanks,  
> Paolo

---

<div class="post-metadata">

**Author:** ![Paolo\_Castagna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paolo_castagna/32/3347_2.png) [@Paolo\_Castagna](https://discuss.elastic.co/u/Paolo_Castagna)\
**Post date:** [March 30, 2010, 8:40pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/5 "2010-03-30T20:40:02Z")

</div>

Shay Banon wrote:

> Is there something I can do to help on this?
> 
> Not in this case. Its not technical problems.

Also, I think one issue might be that there are dependencies from  
another repository (i.e. [http://repository.jboss.com/maven2/](http://repository.jboss.com/maven2/)).

## "All the dependencies have to already be present in the central repository."

> **[Guide to uploading artifacts to the Central Repository – Maven](https://maven.apache.org/repository/guide-central-repository-upload.html)**

There are alternatives though:

- Have your own repo
- Use third parties, for example:  
[Log in with Atlassian account](https://docs.sonatype.com/display/NX/OSS+Repository+Hosting)

> ```
> Are all necessary even if I just want to use the Java client APIs?
> 
> ```
> 
> If you use the server client, then yes. Is there a problem with it?

There isn't a specific problem with it, but I like to understand the  
dependencies and keep them to the minimum number, strictly necessary.

It's one way to make the Jar hell problem, a bit less hell. 🙂

Thanks again,  
Paolo

---

<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:** [March 30, 2010, 8:50pm UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/6 "2010-03-30T20:50:01Z")

</div>

All the jar files under the lib directory are required if you are using a  
cluster of elasticsearch instances.

-shay.banon

On Tue, Mar 30, 2010 at 11:40 PM, Paolo Castagna \<  
[castagna.lists@googlemail.com](mailto:castagna.lists@googlemail.com)\> wrote:

> Shay Banon wrote:
> 
> > Is there something I can do to help on this?
> > 
> > Not in this case. Its not technical problems.
> 
> Also, I think one issue might be that there are dependencies from  
> another repository (i.e. [http://repository.jboss.com/maven2/](http://repository.jboss.com/maven2/)).
> 
> ## "All the dependencies have to already be present in the central repository."
> 
> [Maven – Guide to uploading artifacts to the Central Repository](http://maven.apache.org/guides/mini/guide-central-repository-upload.html)
> 
> There are alternatives though:
> 
> - Have your own repo
> 
> - Use third parties, for example:  
> [Log in with Atlassian account](https://docs.sonatype.com/display/NX/OSS+Repository+Hosting)
> 
> > If you use the server client, then yes. Is there a problem with it?
> 
> There isn't a specific problem with it, but I like to understand the  
> dependencies and keep them to the minimum number, strictly necessary.
> 
> It's one way to make the Jar hell problem, a bit less hell. 🙂
> 
> Thanks again,  
> Paolo

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [March 31, 2010, 7:28am UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/7 "2010-03-31T07:28:03Z")

</div>

It seems to me that Paolo is asking what JARs are needed if the Java program  
has to talk to elasticsearch in no-cluster-joining mode, i.e.  
TransportClient. One nasty way how to learn this would be to do a simple  
test and keep adding one JAR to classpath at a time from ES/lib folder until  
it stops complaining about ClassNotFoundException 🙂

Lukas

On Tue, Mar 30, 2010 at 10:50 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> All the jar files under the lib directory are required if you are using a  
> cluster of elasticsearch instances.
> 
> -shay.banon
> 
> On Tue, Mar 30, 2010 at 11:40 PM, Paolo Castagna \<  
> [castagna.lists@googlemail.com](mailto:castagna.lists@googlemail.com)\> wrote:
> 
> > Shay Banon wrote:
> > 
> > > Is there something I can do to help on this?
> > > 
> > > Not in this case. Its not technical problems.
> > 
> > Also, I think one issue might be that there are dependencies from  
> > another repository (i.e. [http://repository.jboss.com/maven2/](http://repository.jboss.com/maven2/)).
> > 
> > ## "All the dependencies have to already be present in the central repository."
> > 
> > [Maven – Guide to uploading artifacts to the Central Repository](http://maven.apache.org/guides/mini/guide-central-repository-upload.html)
> > 
> > There are alternatives though:
> > 
> > - Have your own repo
> > 
> > - Use third parties, for example:  
> > [Log in with Atlassian account](https://docs.sonatype.com/display/NX/OSS+Repository+Hosting)
> > 
> > > If you use the server client, then yes. Is there a problem with it?
> > 
> > There isn't a specific problem with it, but I like to understand the  
> > dependencies and keep them to the minimum number, strictly necessary.
> > 
> > It's one way to make the Jar hell problem, a bit less hell. 🙂
> > 
> > Thanks again,  
> > Paolo

---

<div class="post-metadata">

**Author:** ![Paolo\_Castagna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paolo_castagna/32/3347_2.png) [@Paolo\_Castagna](https://discuss.elastic.co/u/Paolo_Castagna)\
**Post date:** [March 31, 2010, 7:44am UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/8 "2010-03-31T07:44:31Z")

</div>

LukÃ¡Å¡ VlÄek wrote:

> It seems to me that Paolo is asking what JARs are needed if the Java  
> program has to talk to elasticsearch in no-cluster-joining mode, i.e.  
> TransportClient. One nasty way how to learn this would be to do a simple  
> test and keep adding one JAR to classpath at a time from ES/lib folder  
> until it stops complaining about ClassNotFoundException 🙂

Indeed it would be good to know both for the Server Client (for which  
Shay is telling us it's all) and for the Transport Client. Is the  
Transport Client using an HTTP client and using the REST APIs?

Yes, the 'nasty' way you describe is what I do sometimes, but it is a  
method which does not give me complete confidence since you might not  
touch code with your simple test which requires jars loaded later at  
runtime.

My initial question, though, was about the Server Client.

I'll try and test the Transport Client as well. Indeed, I would like  
some advice on what are the pros/cons in term of performances and  
data transfer between the client and the nodes in the Elasticsearch  
clusters.

The documentation says (about the Transport Client): "most actions will  
probably be 'two hop' operations". I inferred from this that the  
Server Client is better than the Transport Client. (I'll have a look  
at the sources, to better understand the differences).

Paolo

---

<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:** [March 31, 2010, 7:49am UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/9 "2010-03-31T07:49:32Z")

</div>

On Wed, Mar 31, 2010 at 10:44 AM, Paolo Castagna \<  
[castagna.lists@googlemail.com](mailto:castagna.lists@googlemail.com)\> wrote:

> Lukáš Vlček wrote:
> 
> > It seems to me that Paolo is asking what JARs are needed if the Java  
> > program has to talk to elasticsearch in no-cluster-joining mode, i.e.  
> > TransportClient. One nasty way how to learn this would be to do a simple  
> > test and keep adding one JAR to classpath at a time from ES/lib folder until  
> > it stops complaining about ClassNotFoundException 🙂
> 
> Indeed it would be good to know both for the Server Client (for which  
> Shay is telling us it's all) and for the Transport Client. Is the  
> Transport Client using an HTTP client and using the REST APIs?

The Transport Client still uses the low level transport module (which is TCP  
based, with custom serialization/deserialization). I might, in the future,  
implement a REST client also (which can implement the same Client  
interface), but it requires some work (parsing back the JSON into the domain  
driven response objects).

> Yes, the 'nasty' way you describe is what I do sometimes, but it is a  
> method which does not give me complete confidence since you might not  
> touch code with your simple test which requires jars loaded later at  
> runtime.

Yes, thats why its 'nasty' :). I answered regarding the TransportClient on  
another thread, which is, it should not require all the jars (for example,  
the jgroups discovery is not needed). But, I have not tested it with a  
subset of jars.

> My initial question, though, was about the Server Client.
> 
> I'll try and test the Transport Client as well. Indeed, I would like  
> some advice on what are the pros/cons in term of performances and  
> data transfer between the client and the nodes in the Elasticsearch  
> clusters.
> 
> The documentation says (about the Transport Client): "most actions will  
> probably be 'two hop' operations". I inferred from this that the  
> Server Client is better than the Transport Client. (I'll have a look  
> at the sources, to better understand the differences).

The ServerClient will perform better. I will give an example. When you want  
to index a document, the server client will do the routing on the client  
side, and "hit" the shard that will handle the indexing. The TransportClient  
on the other hand simply does a round robin of requests to different nodes,  
and probably, that node will need another hop to hit the actual shard that  
will handle the indexing.

> Paolo

---

<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, 4:24am UTC](https://discuss.elastic.co/t/elasticsearch-artifacts-to-use-via-ant-ivy-and-or-maven/2879/10 "2017-07-06T04:24:58Z")

</div>


