Intellij IDEA 15: Unindexed remote maven repositories found

匿名 (未验证) 提交于 2019-12-03 02:24:01

问题:

I created a Java Gradle project in IntelliJ IDEA 15.0.3. But I am getting the following error.

Unindexed remote maven repositories found. Disable...         The following repositories used in your gradle projects were not indexed yet:          http://repo1.maven.org/maven2         If you want to use dependency completion for these repositories artifacts,         Open Repositories List, select required repositories and press "Update" button (show balloon) 

When I open the repositories list and click update, I am getting the following error

java.lang.RuntimeException: java.io.IOException: Transfer for nexus-maven-repository-index.properties failed 

回答1:

In your build.gradle repositories section replace mavencentral() with another mirror, like so:

repositories {     maven {         url "http://uk.maven.org/maven2"     } } 

then when you get the "Unindexed remote maven repositories found" go to the repositories view and press update. that should do it



回答2:

A possible (though not the only cause for this issue is, that you are behind a firewall that is blocking your connection). In this case you may need to configure a proxy server for Maven.

In my case it helped to just create a new file named settings.xml with the following contents and place it under C:\Users\<username>\.m2\ (or ~/.m2 on linux):

<settings>   <proxies>     <proxy>       <id>HTTP proxy</id>       <active>true</active>       <protocol>http</protocol>       <host>REPLACE_BY_IP_OR_HOSTNAME</host>       <port>REPLACE_BY_PORT_NUMBER</port>     </proxy>      <proxy>       <id>HTTPS proxy</id>       <active>true</active>       <protocol>https</protocol>       <host>REPLACE_BY_IP_OR_HOSTNAME</host>       <port>REPLACE_BY_PORT_NUMBER</port>     </proxy>  </proxies> </settings> 

Replace host and port for your specific environment.



回答3:

Adding proxy settings to VM options worked. This answer helped me to set the proxy settings on IntelliJ for Maven



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!