# Can't find elasticsearch on maven repositories - IntelliJ

**URL:** <https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222>\
**Category:** Elasticsearch\
**Created:** [November 10, 2015, 7:46am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222 "2015-11-10T07:46:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [November 10, 2015, 7:46am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/1 "2015-11-10T07:46:56Z")

</div>

Even though I'm using elasticsearch 1.7.2 through maven on IntelliJ IDEA, I'm not able to add the new dependency:

```
<dependency>
	<groupId>org.elasticsearch</groupId>
	<artifactId>elasticsearch</artifactId>
	<version>2.0.0</version>
</dependency>

```

I added it to the pom file but I cannot find it on the maven repositories when I try to add it to the Project through the Project Settings \> Libraries \> +

Is there any way to update the Maven repositories and find the new API? I'm able to find other libraries like the ones about elasticsearch-twitter or elasticsearch-wikipedia

Thanks in advance

---

<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:** [November 10, 2015, 8:07am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/2 "2015-11-10T08:07:19Z")

</div>

What exact error message you have?

elasticsearch 2.0.0 exists in maven central repositories:

[https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/2.0.0/](https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/2.0.0/)

---

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [November 10, 2015, 8:30am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/3 "2015-11-10T08:30:35Z")

</div>

None, I know it is on the maven repositories but I cannot find it in IntelliJ IDEA. I write org.elasticsearch on the dependency finder and I get no results at all. Neither about the rest of versions.

---

<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:** [November 10, 2015, 8:45am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/4 "2015-11-10T08:45:22Z")

</div>

You mean? When you try to autocomplete when editing the `pom.xml` file?  
May be you have to update the repositories indices? But I think it's not a question specifically related to elasticsearch but to IntelliJ, right?

---

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [November 10, 2015, 8:48am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/5 "2015-11-10T08:48:25Z")

</div>

> May be you have to update the repositories indices?

I did.

I mean when I go to Project Structure \> Libraries and then try to add the dependency by clicking on the + icon and looking for it in the finder.

> But I think it's not a question specifically related to elasticsearch but to IntelliJ, right?

Nope, is not, but I thought that maybe more people had the same problem because is a problem with the elasticsearch dependencies. There is no problem with other libraries.

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 10, 2015, 9:46am UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/6 "2015-11-10T09:46:11Z")

</div>

Everything's fine with IntelliJ IDEA and ES 2.0 here. Use Maven toolbar and the button "Reimport All Maven Projects"

Not sure why you can find elasticsearch-twitter or elasticsearch-wkipedia, they are no longer available for ES 2.0

---

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [November 10, 2015, 12:36pm UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/7 "2015-11-10T12:36:28Z")

</div>

I can't find it when I look on the Maven dependency finder. And I get this execution error when I add the JAR manually:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap

Caused by: java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap  
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)  
... 5 more

---

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [November 10, 2015, 2:09pm UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/8 "2015-11-10T14:09:08Z")

</div>

The error that I get is in this line:

```
Settings settings = Settings.settingsBuilder().put("cluster.name", Receptor.clusterName).build();

```

Everything looks fine for me but I don't know why I keep getting this error:

> Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSet;  
> at org.elasticsearch.common.Strings.(Strings.java:459)  
> at org.elasticsearch.common.settings.Settings.(Settings.java:88)  
> at org.elasticsearch.common.settings.Settings$Builder.build(Settings.java:1211)  
> at ElasticSender.getClient(ElasticSender.java:75)

---

<div class="post-metadata">

**Author:** ![Carlos\_Vega\_Moreno](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_vega_moreno/32/3773_2.png) [@Carlos\_Vega\_Moreno](https://discuss.elastic.co/u/Carlos_Vega_Moreno)\
**Post date:** [November 10, 2015, 2:45pm UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/9 "2015-11-10T14:45:52Z")

</div>

I solved the issue by creating a new idea project and adding my sources and the maven dependencies manually to the pom. Everything fine now, something must be corrupted in the idea files.

Thanks

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [November 10, 2015, 2:54pm UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/10 "2015-11-10T14:54:16Z")

</div>

Normally, by opening a Maven project, IntelliJ imports all maven dependencies automatically.

---

<div class="post-metadata">

**Author:** ![3ary](https://avatars.discourse-cdn.com/v4/letter/3/ecc23a/32.png) [@3ary](https://discuss.elastic.co/u/3ary)\
**Post date:** [October 11, 2016, 4:32pm UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/11 "2016-10-11T16:32:08Z")

</div>

Usually when I have an issue like that (nothing changes no matter how many repos I added and several versions. Reimporting , Downloading sources to maven projects) there is something wrong with the pom structure.

---

<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 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/cant-find-elasticsearch-on-maven-repositories-intellij/34222/12 "2017-07-05T22:13:22Z")

</div>


