# POM for ElasticSearch 0.17.2

**URL:** <https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040>\
**Category:** Elasticsearch\
**Created:** [August 3, 2011, 12:05am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040 "2011-08-03T00:05:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jabawaba\_2](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jabawaba\_2](https://discuss.elastic.co/u/jabawaba_2)\
**Post date:** [August 3, 2011, 12:05am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/1 "2011-08-03T00:05:20Z")

</div>

Hi,

I'm new to ElasticSearch and Lucene (2 weeks) and especially to maven  
(yesterday). I am writing java proof of concept to learn how to use  
ES. I was successful in writing Apache Http Client and Jersey clients  
to communicate with ES. The two clients were developed in maven. Now,  
I am trying to replicate the effort using the native ES java client  
but I am having trouble downloading the ES jars so I can use them to  
build my ES java client.

My POM (shown at the end) is having trouble parsing:  
  
org.elasticsearch  
elasticsearch  
0.17.2

As you can see, I tried both 0.16.0 and 0.17.2 to no avail. Can you  
please help/show me how to update my pom in order to get the client to  
build on maven.

On a related note, the primary aim of this POC is to figure out how to  
access the ES POJOs for both the request and response. In other words,  
so far, I have been exchanging JSONs between Jersey and ES.  
Consequently, I had to write my own java POJO, and using jackson, to  
convert the returned JSON (from ES rest api) to POJO. I found that to  
be cumbersome.  
Given the following JSON, my guess is that there should be a mapped  
POJO in the public ES API  
{  
"query": {  
"filtered" : {  
"query" : {  
"query\_string" : {  
"query" : "some query string here"  
}  
},  
"filter" : {  
"term" : { "user" : "kimchy" }  
}  
}  
}  
}  
And conversely, the result set JSON should have it's own public POJO.  
Without these public POJOs, I will have to write dozens of POJOs to  
represent the various request and response JSONS.

I my guess correct? If so, can you provide me with the package path.

Thank you for taking the time to help me with these two problems.

============================================================

4.0.0  
  
  
  
[maven2-repository.java.net](http://maven2-repository.java.net)  
[Java.net](http://Java.net) Repository for Maven  
[http://download.java.net/maven/2/](http://download.java.net/maven/2/)  
default  
  
  
[maven-repository.java.net](http://maven-repository.java.net)  
[Java.net](http://Java.net) Maven 1 Repository (legacy)  
[http://download.java.net/maven/1](http://download.java.net/maven/1)  
legacy  
  
  
  
  
[oss.sonatype.org](http://oss.sonatype.org)  
OSS Sonatype  
  
true  
  
  
false  
  
[https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
releases/  
  
  
sonatype-snapshots  
Sonatype Snapshots Repository  
[http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
snapshots/  
  
true  
  
  
  
  
com.example.es  
es  
  
1.0-SNAPSHOT  
es  
[http://maven.apache.org](http://maven.apache.org)  
  
  
  
org.apache.maven.plugins  
maven-compiler-plugin  
2.3.2  
  
1.6  
1.6

```
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2.1</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</

```

descriptorRef\>

com.example.es.apachehttpclient.Delete

com.example.es.apachehttpclient.Index

com.example.es.apachehttpclient.Search  
com.example.es.jersey.Search\</  
mainClass\>

```
<dependencies>
    <!-- Start ElasticSearch Dependencies -->
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>0.16.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>3.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-analyzers</artifactId>
        <version>3.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-snowball</artifactId>
        <version>3.0.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-fast-vector-highlighter</artifactId>
        <version>3.0.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-highlighter</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-queries</artifactId>
        <version>2.4.0</version>
    </dependency>
    <!-- End ElasticSearch Dependencies -->
    <!-- Start Jersey Dependencies -->
    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-client</artifactId>
        <version>1.8</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-apache-client</artifactId>
        <version>1.8</version>
    </dependency>
    <!-- End Jersey Dependencies -->
    <!-- Start Apache Http Client Dependencies -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.1.1</version>
    </dependency>
    <!-- End Apache Http Client Dependencies -->
    <!-- Start JUNIT Dependencies -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.2</version>
        <scope>test</scope>
    </dependency>
    <!-- End JUNIT Dependencies -->
</dependencies>

```

---

<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:** [August 3, 2011, 3:32am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/2 "2011-08-03T03:32:35Z")

</div>

Your maven settings look correct, although I am not sure the newlines are  
caused by your email editor or not:

...  
[https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
releases/  
...  
[http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
snapshots/  
...

Are the newlines after .../repositories/ in the original source? If so,  
those are the culprits.

You can see the POMs here:  
[https://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch/](https://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch/)

As far as POJOs go, you do have the org.elasticsearch.action.ActionRequest  
and org.elasticsearch.action.ActionResponse class hierarchies, however  
instances are are probably better created using static factories and  
builders and not via a simple constructor.

The actual hits in a SearchResponse are of  
type org.elasticsearch.search.SearchHit

BTW, it would be great to have the API online instead of having to point to  
source code in github.

--  
Ivan

On Tue, Aug 2, 2011 at 8:05 PM, jabawaba [sfmo8080@gmail.com](mailto:sfmo8080@gmail.com) wrote:

> Hi,
> 
> I'm new to Elasticsearch and Lucene (2 weeks) and especially to maven  
> (yesterday). I am writing java proof of concept to learn how to use  
> ES. I was successful in writing Apache Http Client and Jersey clients  
> to communicate with ES. The two clients were developed in maven. Now,  
> I am trying to replicate the effort using the native ES java client  
> but I am having trouble downloading the ES jars so I can use them to  
> build my ES java client.
> 
> My POM (shown at the end) is having trouble parsing:  
>   
> org.elasticsearch  
> elasticsearch  
> 0.17.2
> 
> As you can see, I tried both 0.16.0 and 0.17.2 to no avail. Can you  
> please help/show me how to update my pom in order to get the client to  
> build on maven.
> 
> On a related note, the primary aim of this POC is to figure out how to  
> access the ES POJOs for both the request and response. In other words,  
> so far, I have been exchanging JSONs between Jersey and ES.  
> Consequently, I had to write my own java POJO, and using jackson, to  
> convert the returned JSON (from ES rest api) to POJO. I found that to  
> be cumbersome.  
> Given the following JSON, my guess is that there should be a mapped  
> POJO in the public ES API  
> {  
> "query": {  
> "filtered" : {  
> "query" : {  
> "query\_string" : {  
> "query" : "some query string here"  
> }  
> },  
> "filter" : {  
> "term" : { "user" : "kimchy" }  
> }  
> }  
> }  
> }  
> And conversely, the result set JSON should have it's own public POJO.  
> Without these public POJOs, I will have to write dozens of POJOs to  
> represent the various request and response JSONS.
> 
> I my guess correct? If so, can you provide me with the package path.
> 
> Thank you for taking the time to help me with these two problems.
> 
> ============================================================
> 
> 4.0.0  
>   
>   
>   
> [maven2-repository.java.net](http://maven2-repository.java.net)  
> [Java.net](http://Java.net) Repository for Maven  
> [http://download.java.net/maven/2/](http://download.java.net/maven/2/)  
> default  
>   
>   
> [maven-repository.java.net](http://maven-repository.java.net)  
> [Java.net](http://Java.net) Maven 1 Repository (legacy)  
> [http://download.java.net/maven/1](http://download.java.net/maven/1)  
> legacy  
>   
>   
>   
>   
> [oss.sonatype.org](http://oss.sonatype.org)  
> OSS Sonatype  
>   
> true  
>   
>   
> false  
>   
> [https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
> releases/  
>   
>   
> sonatype-snapshots  
> Sonatype Snapshots Repository  
> [http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
> snapshots/  
>   
> true  
>   
>   
>   
>   
> com.example.es  
> es
> 
> 1.0-SNAPSHOT  
> es  
> [http://maven.apache.org](http://maven.apache.org)  
>   
>   
>   
> org.apache.maven.plugins  
> maven-compiler-plugin  
> 2.3.2  
>   
> 1.6  
> 1.6
> 
> ```
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.2.1</version>
> <configuration>
> <descriptorRefs>
> <descriptorRef>jar-with-dependencies</
> 
> ```
> 
> descriptorRef\>
> 
> com.example.es.apachehttpclient.Delete
> 
> com.example.es.apachehttpclient.Index
> 
> com.example.es.apachehttpclient.Search  
> com.example.es.jersey.Search\</  
> mainClass\>
> 
> org.elasticsearch elasticsearch 0.16.0 org.apache.lucene lucene-core 3.3.0 org.apache.lucene lucene-analyzers 3.3.0 org.apache.lucene lucene-snowball 3.0.3 org.apache.lucene lucene-fast-vector-highlighter 3.0.3 org.apache.lucene lucene-highlighter 2.4.0 org.apache.lucene lucene-queries 2.4.0 com.sun.jersey jersey-client 1.8 com.sun.jersey.contribs jersey-apache-client 1.8 org.apache.httpcomponents httpclient 4.1.1 junit junit 3.8.2 test

---

<div class="post-metadata">

**Author:** ![jabawaba\_2](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jabawaba\_2](https://discuss.elastic.co/u/jabawaba_2)\
**Post date:** [August 3, 2011, 6:20am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/3 "2011-08-03T06:20:03Z")

</div>

Hi Ivan,

Thank you for your reply.

1. You are correct, my POM doesn't have newlines. I don't know how the  
got inserted. I noticed there was a slash at the end (after releases  
and snapshots). I removed them but made no difference.

releases  
  
  
sonatype-snapshots  
Sonatype Snapshots Repository  
[http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
snapshots  
  
true

1. Here is my very primitive java client. I'm just trying to test  
whether maven can pick up the ES jars. Apparently it can't.

package com.example.es.es;  
import org.elasticsearch.client.Client;  
import org.elasticsearch.client.transport.TransportClient;  
import org.elasticsearch.common.transport.InetSocketTransportAddress;

public class Search {

public static void main(String args) {

```
// on startup

Client client = null;

try {
  client = new TransportClient()
          .addTransportAddress(new

```

InetSocketTransportAddress("localhost", 9300))  
.addTransportAddress(new  
InetSocketTransportAddress("localhost", 9300));  
// my stuff goes here.  
} finally {  
// on shutdown  
client.close();  
}  
}  
}

1. And here is the output from mvn compile (I use mvn  
assembly:assembly in order to construct the entire jar w/o  
dependencies, but initially, I want to get compile to work). I noticed  
on repos uses https another uses http. I tried all four combinations  
of http and https to no avail.

## $ mvn compile [INFO] Scanning for projects... [INFO]

## [INFO] Building es [INFO] task-segment: [compile] [INFO]

## [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/admin/dev/ elasticsearch/examples/java/maven/es/src/main/resources Downloading: [http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom](http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom) [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' in repository [maven2-repository.java.net](http://maven2-repository.java.net) (http:// [download.java.net/maven/2/](http://download.java.net/maven/2/)) Downloading: [http://download.java.net/maven/1/org.elasticsearch/poms/elasticsearch-0.17.2.pom](http://download.java.net/maven/1/org.elasticsearch/poms/elasticsearch-0.17.2.pom) [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' in repository [maven-repository.java.net](http://maven-repository.java.net) (http:// [download.java.net/maven/1](http://download.java.net/maven/1)) Downloading: [https://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom](https://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom) [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' from repository [oss.sonatype.org](http://oss.sonatype.org) ([https://oss.sonatype.org/](https://oss.sonatype.org/) content/repositories/releases): Error transferring file: Operation timed out Downloading: [http://oss.sonatype.org/content/repositories/snapshots/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom](http://oss.sonatype.org/content/repositories/snapshots/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom) [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' from repository sonatype-snapshots ([http://oss.sonatype.org/](http://oss.sonatype.org/) content/repositories/snapshots): Error transferring file: Operation timed out Downloading: [http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom](http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.pom) [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' in repository central ([Central Repository:](http://repo1.maven.org/maven2)) Downloading: [http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar](http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar) [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' in repository [maven2-repository.java.net](http://maven2-repository.java.net) (http:// [download.java.net/maven/2/](http://download.java.net/maven/2/)) Downloading: [http://download.java.net/maven/1/org.elasticsearch/jars/elasticsearch-0.17.2.jar](http://download.java.net/maven/1/org.elasticsearch/jars/elasticsearch-0.17.2.jar) [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' in repository [maven-repository.java.net](http://maven-repository.java.net) (http:// [download.java.net/maven/1](http://download.java.net/maven/1)) Downloading: [https://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar](https://oss.sonatype.org/content/repositories/releases/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar) [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' from repository [oss.sonatype.org](http://oss.sonatype.org) ([https://oss.sonatype.org/](https://oss.sonatype.org/) content/repositories/releases): Error transferring file: Operation timed out Downloading: [http://oss.sonatype.org/content/repositories/snapshots/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar](http://oss.sonatype.org/content/repositories/snapshots/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar) [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' from repository sonatype-snapshots ([http://oss.sonatype.org/](http://oss.sonatype.org/) content/repositories/snapshots): Error transferring file: Operation timed out Downloading: [http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar](http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/elasticsearch-0.17.2.jar) [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' in repository central ([Central Repository:](http://repo1.maven.org/maven2)) [INFO]

## [ERROR] BUILD ERROR [INFO]

[INFO] Failed to resolve artifact.

Any help is greatly appreciated.  
Thank you

On Aug 2, 8:32 pm, Ivan Brusic [i...@brusic.com](mailto:i...@brusic.com) wrote:

> Your maven settings look correct, although I am not sure the newlines are  
> caused by your email editor or not:
> 
> ...  
> [https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
> releases/  
> ...  
> [http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
> snapshots/  
> ...
> 
> Are the newlines after .../repositories/ in the original source? If so,  
> those are the culprits.
> 
> You can see the POMs here:[https://oss.sonatype.org/content/repositories/releases/org/elasticsea](https://oss.sonatype.org/content/repositories/releases/org/elasticsea)...
> 
> As far as POJOs go, you do have the org.elasticsearch.action.ActionRequest  
> and org.elasticsearch.action.ActionResponse class hierarchies, however  
> instances are are probably better created using static factories and  
> builders and not via a simple constructor.
> 
> The actual hits in a SearchResponse are of  
> type org.elasticsearch.search.SearchHit
> 
> BTW, it would be great to have the API online instead of having to point to  
> source code in github.
> 
> --  
> Ivan
> 
> On Tue, Aug 2, 2011 at 8:05 PM, jabawaba [sfmo8...@gmail.com](mailto:sfmo8...@gmail.com) wrote:
> 
> > Hi,
> 
> > I'm new to Elasticsearch and Lucene (2 weeks) and especially to maven  
> > (yesterday). I am writing java proof of concept to learn how to use  
> > ES. I was successful in writing Apache Http Client and Jersey clients  
> > to communicate with ES. The two clients were developed in maven. Now,  
> > I am trying to replicate the effort using the native ES java client  
> > but I am having trouble downloading the ES jars so I can use them to  
> > build my ES java client.
> 
> > My POM (shown at the end) is having trouble parsing:  
> >   
> > org.elasticsearch  
> > elasticsearch  
> > 0.17.2
> 
> > As you can see, I tried both 0.16.0 and 0.17.2 to no avail. Can you  
> > please help/show me how to update my pom in order to get the client to  
> > build on maven.
> 
> > On a related note, the primary aim of this POC is to figure out how to  
> > access the ES POJOs for both the request and response. In other words,  
> > so far, I have been exchanging JSONs between Jersey and ES.  
> > Consequently, I had to write my own java POJO, and using jackson, to  
> > convert the returned JSON (from ES rest api) to POJO. I found that to  
> > be cumbersome.  
> > Given the following JSON, my guess is that there should be a mapped  
> > POJO in the public ES API  
> > {  
> > "query": {  
> > "filtered" : {  
> > "query" : {  
> > "query\_string" : {  
> > "query" : "some query string here"  
> > }  
> > },  
> > "filter" : {  
> > "term" : { "user" : "kimchy" }  
> > }  
> > }  
> > }  
> > }  
> > And conversely, the result set JSON should have it's own public POJO.  
> > Without these public POJOs, I will have to write dozens of POJOs to  
> > represent the various request and response JSONS.
> 
> > I my guess correct? If so, can you provide me with the package path.
> 
> > Thank you for taking the time to help me with these two problems.
> 
> > ============================================================
> 
> > 4.0.0  
> >   
> >   
> >   
> > [maven2-repository.java.net](http://maven2-repository.java.net)  
> > [Java.net](http://Java.net) Repository for Maven  
> > [http://download.java.net/maven/2/](http://download.java.net/maven/2/)  
> > default  
> >   
> >   
> > [maven-repository.java.net](http://maven-repository.java.net)  
> > [Java.net](http://Java.net) Maven 1 Repository (legacy)  
> > [http://download.java.net/maven/1](http://download.java.net/maven/1)  
> > legacy  
> >   
> >   
> >   
> >   
> > [oss.sonatype.org](http://oss.sonatype.org)  
> > OSS Sonatype  
> >   
> > true  
> >   
> >   
> > false  
> >   
> > [https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
> > releases/  
> >   
> >   
> > sonatype-snapshots  
> > Sonatype Snapshots Repository  
> > [http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
> > snapshots/  
> >   
> > true  
> >   
> >   
> >   
> >   
> > com.example.es  
> > es
> > 
> > 1.0-SNAPSHOT  
> > es  
> > [http://maven.apache.org](http://maven.apache.org)  
> >   
> >   
> >   
> > org.apache.maven.plugins  
> > maven-compiler-plugin  
> > 2.3.2  
> >   
> > 1.6  
> > 1.6
> 
> > ```
> > <plugin>
> > <artifactId>maven-assembly-plugin</artifactId>
> > <version>2.2.1</version>
> > <configuration>
> > <descriptorRefs>
> > <descriptorRef>jar-with-dependencies</
> > 
> > ```
> > 
> > descriptorRef\>
> 
> > com.example.es.apachehttpclient.Delete
> 
> > com.example.es.apachehttpclient.Index
> 
> > com.example.es.apachehttpclient.Search  
> > com.example.es.jersey.Search\</  
> > mainClass\>
> 
> > org.elasticsearch elasticsearch 0.16.0 org.apache.lucene lucene-core 3.3.0 org.apache.lucene lucene-analyzers 3.3.0 org.apache.lucene lucene-snowball 3.0.3 org.apache.lucene lucene-fast-vector-highlighter 3.0.3 org.apache.lucene lucene-highlighter 2.4.0 org.apache.lucene lucene-queries 2.4.0 com.sun.jersey jersey-client 1.8 com.sun.jersey.contribs jersey-apache-client 1.8 org.apache.httpcomponents httpclient 4.1.1 junit junit 3.8.2 test

---

<div class="post-metadata">

**Author:** ![jabawaba\_2](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jabawaba\_2](https://discuss.elastic.co/u/jabawaba_2)\
**Post date:** [August 3, 2011, 6:33am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/4 "2011-08-03T06:33:40Z")

</div>

Hi Ivan,

After running it twice with absolutely no changes to the POM or source  
code, maven was able to download the jar. Very weird. Can not explain  
it.

Thank you for your help.  
jabawaba

On Aug 2, 11:20 pm, jabawaba [sfmo8...@gmail.com](mailto:sfmo8...@gmail.com) wrote:

> Hi Ivan,
> 
> Thank you for your reply.
> 
> 1. You are correct, my POM doesn't have newlines. I don't know how the  
> got inserted. I noticed there was a slash at the end (after releases  
> and snapshots). I removed them but made no difference.
> 
> releases  
>   
>   
> sonatype-snapshots  
> Sonatype Snapshots Repository  
> [http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
> snapshots  
>   
> true
> 
> 1. Here is my very primitive java client. I'm just trying to test  
> whether maven can pick up the ES jars. Apparently it can't.
> 
> package com.example.es.es;  
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;
> 
> public class Search {
> 
> public static void main(String args) {
> 
> ```
> // on startup
> 
> Client client = null;
> 
> try {
> client = new TransportClient()
> .addTransportAddress(new
> 
> ```
> 
> InetSocketTransportAddress("localhost", 9300))  
> .addTransportAddress(new  
> InetSocketTransportAddress("localhost", 9300));  
> // my stuff goes here.  
> } finally {  
> // on shutdown  
> client.close();  
> }  
> }
> 
> }
> 
> 1. And here is the output from mvn compile (I use mvn  
> assembly:assembly in order to construct the entire jar w/o  
> dependencies, but initially, I want to get compile to work). I noticed  
> on repos uses https another uses http. I tried all four combinations  
> of http and https to no avail.
> 
> ## $ mvn compile [INFO] Scanning for projects... [INFO]
> 
> ## [INFO] Building es [INFO] task-segment: [compile] [INFO]
> 
> ## [INFO] [resources:resources {execution: default-resources}] [WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /Users/admin/dev/ elasticsearch/examples/java/maven/es/src/main/resources Downloading:[http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.1](http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.1)... [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' in repository [maven2-repository.java.net](http://maven2-repository.java.net) (http:// [download.java.net/maven/2/](http://download.java.net/maven/2/)) Downloading:[http://download.java.net/maven/1/org.elasticsearch/poms/elasticsearch](http://download.java.net/maven/1/org.elasticsearch/poms/elasticsearch)... [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' in repository [maven-repository.java.net](http://maven-repository.java.net) (http:// [download.java.net/maven/1](http://download.java.net/maven/1)) Downloading:[https://oss.sonatype.org/content/repositories/releases/org/elasticsea](https://oss.sonatype.org/content/repositories/releases/org/elasticsea)... [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' from repository [oss.sonatype.org](http://oss.sonatype.org) ([https://oss.sonatype.org/](https://oss.sonatype.org/) content/repositories/releases): Error transferring file: Operation timed out Downloading:[http://oss.sonatype.org/content/repositories/snapshots/org/elasticsea](http://oss.sonatype.org/content/repositories/snapshots/org/elasticsea)... [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' from repository sonatype-snapshots ([http://oss.sonatype.org/](http://oss.sonatype.org/) content/repositories/snapshots): Error transferring file: Operation timed out Downloading:[http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/](http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/)... [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:pom: 0.17.2' in repository central ([http://repo1.maven.org/maven2](http://repo1.maven.org/maven2)) Downloading:[http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.1](http://download.java.net/maven/2//org/elasticsearch/elasticsearch/0.1)... [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' in repository [maven2-repository.java.net](http://maven2-repository.java.net) (http:// [download.java.net/maven/2/](http://download.java.net/maven/2/)) Downloading:[http://download.java.net/maven/1/org.elasticsearch/jars/elasticsearch](http://download.java.net/maven/1/org.elasticsearch/jars/elasticsearch)... [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' in repository [maven-repository.java.net](http://maven-repository.java.net) (http:// [download.java.net/maven/1](http://download.java.net/maven/1)) Downloading:[https://oss.sonatype.org/content/repositories/releases/org/elasticsea](https://oss.sonatype.org/content/repositories/releases/org/elasticsea)... [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' from repository [oss.sonatype.org](http://oss.sonatype.org) ([https://oss.sonatype.org/](https://oss.sonatype.org/) content/repositories/releases): Error transferring file: Operation timed out Downloading:[http://oss.sonatype.org/content/repositories/snapshots/org/elasticsea](http://oss.sonatype.org/content/repositories/snapshots/org/elasticsea)... [WARNING] Unable to get resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' from repository sonatype-snapshots ([http://oss.sonatype.org/](http://oss.sonatype.org/) content/repositories/snapshots): Error transferring file: Operation timed out Downloading:[http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/](http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/0.17.2/)... [INFO] Unable to find resource 'org.elasticsearch:elasticsearch:jar: 0.17.2' in repository central ([http://repo1.maven.org/maven2](http://repo1.maven.org/maven2)) [INFO]
> 
> ## [ERROR] BUILD ERROR [INFO]
> 
> [INFO] Failed to resolve artifact.
> 
> Any help is greatly appreciated.  
> Thank you
> 
> On Aug 2, 8:32 pm, Ivan Brusic [i...@brusic.com](mailto:i...@brusic.com) wrote:
> 
> > Your maven settings look correct, although I am not sure the newlines are  
> > caused by your email editor or not:
> 
> > ...  
> > [https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
> > releases/  
> > ...  
> > [http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
> > snapshots/  
> > ...
> 
> > Are the newlines after .../repositories/ in the original source? If so,  
> > those are the culprits.
> 
> > You can see the POMs here:[https://oss.sonatype.org/content/repositories/releases/org/elasticsea](https://oss.sonatype.org/content/repositories/releases/org/elasticsea)...
> 
> > As far as POJOs go, you do have the org.elasticsearch.action.ActionRequest  
> > and org.elasticsearch.action.ActionResponse class hierarchies, however  
> > instances are are probably better created using static factories and  
> > builders and not via a simple constructor.
> 
> > The actual hits in a SearchResponse are of  
> > type org.elasticsearch.search.SearchHit
> 
> > BTW, it would be great to have the API online instead of having to point to  
> > source code in github.
> 
> > --  
> > Ivan
> 
> > On Tue, Aug 2, 2011 at 8:05 PM, jabawaba [sfmo8...@gmail.com](mailto:sfmo8...@gmail.com) wrote:
> > 
> > > Hi,
> 
> > > I'm new to Elasticsearch and Lucene (2 weeks) and especially to maven  
> > > (yesterday). I am writing java proof of concept to learn how to use  
> > > ES. I was successful in writing Apache Http Client and Jersey clients  
> > > to communicate with ES. The two clients were developed in maven. Now,  
> > > I am trying to replicate the effort using the native ES java client  
> > > but I am having trouble downloading the ES jars so I can use them to  
> > > build my ES java client.
> 
> > > My POM (shown at the end) is having trouble parsing:  
> > >   
> > > org.elasticsearch  
> > > elasticsearch  
> > > 0.17.2
> 
> > > As you can see, I tried both 0.16.0 and 0.17.2 to no avail. Can you  
> > > please help/show me how to update my pom in order to get the client to  
> > > build on maven.
> 
> > > On a related note, the primary aim of this POC is to figure out how to  
> > > access the ES POJOs for both the request and response. In other words,  
> > > so far, I have been exchanging JSONs between Jersey and ES.  
> > > Consequently, I had to write my own java POJO, and using jackson, to  
> > > convert the returned JSON (from ES rest api) to POJO. I found that to  
> > > be cumbersome.  
> > > Given the following JSON, my guess is that there should be a mapped  
> > > POJO in the public ES API  
> > > {  
> > > "query": {  
> > > "filtered" : {  
> > > "query" : {  
> > > "query\_string" : {  
> > > "query" : "some query string here"  
> > > }  
> > > },  
> > > "filter" : {  
> > > "term" : { "user" : "kimchy" }  
> > > }  
> > > }  
> > > }  
> > > }  
> > > And conversely, the result set JSON should have it's own public POJO.  
> > > Without these public POJOs, I will have to write dozens of POJOs to  
> > > represent the various request and response JSONS.
> 
> > > I my guess correct? If so, can you provide me with the package path.
> 
> > > Thank you for taking the time to help me with these two problems.
> 
> > > ============================================================
> 
> > > \<project xmlns="[http://maven.apache.org/POM/4.0.0](http://maven.apache.org/POM/4.0.0)"
> 
> ...
> 
> read more »

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 3, 2011, 6:55am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/5 "2011-08-03T06:55:26Z")

</div>

I would suggest to try to modify your sonatype repo settings with :

> ```
> <repository>
> <id>oss.sonatype.org</id>
> <name>OSS Sonatype</name>
> <releases>
> <enabled>true</enabled>
> </releases>
> <snapshots>
> <enabled>false</enabled>
> </snapshots>
> <url>http://oss.sonatype.org/content/repositories/
> 
> ```
> 
> releases/

Note the http instead of https.  
If you work from your company network, then you can have proxy problems with https ???

I suppose that you have a message like "could not find jar for ..." ? What is your exact error message ?

Hope this helps.  
David 😉

Le 3 août 2011 à 02:05, jabawaba [sfmo8080@gmail.com](mailto:sfmo8080@gmail.com) a écrit :

> Hi,
> 
> I'm new to Elasticsearch and Lucene (2 weeks) and especially to maven  
> (yesterday). I am writing java proof of concept to learn how to use  
> ES. I was successful in writing Apache Http Client and Jersey clients  
> to communicate with ES. The two clients were developed in maven. Now,  
> I am trying to replicate the effort using the native ES java client  
> but I am having trouble downloading the ES jars so I can use them to  
> build my ES java client.
> 
> My POM (shown at the end) is having trouble parsing:  
>   
> org.elasticsearch  
> elasticsearch  
> 0.17.2
> 
> As you can see, I tried both 0.16.0 and 0.17.2 to no avail. Can you  
> please help/show me how to update my pom in order to get the client to  
> build on maven.
> 
> On a related note, the primary aim of this POC is to figure out how to  
> access the ES POJOs for both the request and response. In other words,  
> so far, I have been exchanging JSONs between Jersey and ES.  
> Consequently, I had to write my own java POJO, and using jackson, to  
> convert the returned JSON (from ES rest api) to POJO. I found that to  
> be cumbersome.  
> Given the following JSON, my guess is that there should be a mapped  
> POJO in the public ES API  
> {  
> "query": {  
> "filtered" : {  
> "query" : {  
> "query\_string" : {  
> "query" : "some query string here"  
> }  
> },  
> "filter" : {  
> "term" : { "user" : "kimchy" }  
> }  
> }  
> }  
> }  
> And conversely, the result set JSON should have it's own public POJO.  
> Without these public POJOs, I will have to write dozens of POJOs to  
> represent the various request and response JSONS.
> 
> I my guess correct? If so, can you provide me with the package path.
> 
> Thank you for taking the time to help me with these two problems.
> 
> ============================================================
> 
> 4.0.0  
>   
>   
>   
> [maven2-repository.java.net](http://maven2-repository.java.net)  
> [Java.net](http://Java.net) Repository for Maven  
> [http://download.java.net/maven/2/](http://download.java.net/maven/2/)  
> default  
>   
>   
> [maven-repository.java.net](http://maven-repository.java.net)  
> [Java.net](http://Java.net) Maven 1 Repository (legacy)  
> [http://download.java.net/maven/1](http://download.java.net/maven/1)  
> legacy  
>   
>   
>   
>   
> [oss.sonatype.org](http://oss.sonatype.org)  
> OSS Sonatype  
>   
> true  
>   
>   
> false  
>   
> [https://oss.sonatype.org/content/repositories/](https://oss.sonatype.org/content/repositories/)  
> releases/  
>   
>   
> sonatype-snapshots  
> Sonatype Snapshots Repository  
> [http://oss.sonatype.org/content/repositories/](http://oss.sonatype.org/content/repositories/)  
> snapshots/  
>   
> true  
>   
>   
>   
>   
> com.example.es  
> es
> 
> 1.0-SNAPSHOT  
> es  
> [http://maven.apache.org](http://maven.apache.org)  
>   
>   
>   
> org.apache.maven.plugins  
> maven-compiler-plugin  
> 2.3.2  
>   
> 1.6  
> 1.6
> 
> ```
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.2.1</version>
> <configuration>
> <descriptorRefs>
> <descriptorRef>jar-with-dependencies</
> 
> ```
> 
> descriptorRef\>
> 
> com.example.es.apachehttpclient.Delete
> 
> com.example.es.apachehttpclient.Index
> 
> com.example.es.apachehttpclient.Search  
> com.example.es.jersey.Search\</  
> mainClass\>
> 
> org.elasticsearch elasticsearch 0.16.0 org.apache.lucene lucene-core 3.3.0 org.apache.lucene lucene-analyzers 3.3.0 org.apache.lucene lucene-snowball 3.0.3 org.apache.lucene lucene-fast-vector-highlighter 3.0.3 org.apache.lucene lucene-highlighter 2.4.0 org.apache.lucene lucene-queries 2.4.0 com.sun.jersey jersey-client 1.8 com.sun.jersey.contribs jersey-apache-client 1.8 org.apache.httpcomponents httpclient 4.1.1 junit junit 3.8.2 test

---

<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:** [August 3, 2011, 1:09pm UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/6 "2011-08-03T13:09:32Z")

</div>

What's that? Maven/ivy download issues? Impossible! That should never  
happen.

Oh wait, it does all the time. Repos down, connectivity blips and proxy  
issues all contribute to tons of hair pulling when using external dependency  
management. If your company is large enough, it might make sense to install  
a maven proxy/cache.

--  
Ivan

On Wed, Aug 3, 2011 at 2:33 AM, jabawaba [sfmo8080@gmail.com](mailto:sfmo8080@gmail.com) wrote:

> Hi Ivan,
> 
> After running it twice with absolutely no changes to the POM or source  
> code, maven was able to download the jar. Very weird. Can not explain  
> it.
> 
> Thank you for your help.  
> jabawaba

---

<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:58am UTC](https://discuss.elastic.co/t/pom-for-elasticsearch-0-17-2/5040/7 "2017-07-06T03:58:21Z")

</div>


